Re: Perl/unix script to convert a fixed width file to a tab delimited file




"Srikant" <srikantics@xxxxxxxxx> wrote in message news:1191072950.845896.75120@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
: Hi all,
: I have a situtation here. We have a script that reads two
: delimited (comma or tab or pipe or semicolon or any other) files and
: compares them returnig the list of records/rows unique to file1,
: unique to file2 and the mismatches records.
: Now, we also have to get this going for fixed width files. I
: know that the inbuilt excel tool, Text to columns, does this. However
: we need to get this process automated on the unix box.

If the files are sorted you can just use the comm utility. Else,
perldoc -f pack and perldoc -f unpack for the unpack utility.
It's a trivial one liner to convert a file from fixed width to
csv.

Dan Mercer

: Any suggestions? If someone can help me with the scipt itself,
: that'll be awesome.
:
:
: Thanks a lot.
:
: Regards
: Srikant
:


.