Parse each line by character location

Tyler hayes.tyler at gmail.com
Wed Nov 5 10:24:28 EST 2008


>         So you have a classic (especially for COBOL and older FORTRAN) fixed
> field record layout, no?

Exactly, I believe COBOL. It is a daily reconciliation with an
exchange and our system's orders. One of the problems of dealing with
these old legacy systems that never seem to go away....

>
>         I presume the entire file is of a single layout? That would mean
> only one splitting format is needed...

Again, correct, I only need the one format as it does not change. I
want to move it to a csv file because the application that we are
implementing reads these natively, and does not have a built in
mechanism to parse a file like this effectively. Further, this will
allow me to add some other fields for our own use. As such, the final
file will look somewhat different, but this step kinda threw me. I
started out with AWK, and didn't know whether to laugh or cry.
Thankfully, I was able to convince the "guys" to allow me to install
Python on my dev workstation (although already on production SUSE
servers).

Cheers,

t.



More information about the Python-list mailing list