• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 694
  • Last Modified:

Unix utility for converting a flat file to Excel, DBF format

Is there a utility that runs in Unix and will convert a flat Unix disk file with columnar data into a flat Unix disk file with an Excel format?  Or a .dbf (xBase) format?
0
awhite1
Asked:
awhite1
  • 2
1 Solution
 
fveilletCommented:
The easiest with flat files, is to use awk to reformat your file from columnar to commas seperated (.csv).  Excel can easily import a CSV file.
0
 
awhite1Author Commented:
Great -- thank you!
0
 
fveilletCommented:
One trick with awk, is to set the Output Field Seperator different (OFS) from the Input Field Seperator (FS).
For example:

BEGIN { FS=" "; OFS=","; }
{ print $1,$2,$3,$4,$5; }

Hope this helps,

fveillet
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now