Legacy data parsing

brian at mirror.org brian at mirror.org
Fri Jul 8 23:36:26 CEST 2005

> Where I work, we receive large quantities of data which is currently
> all printed on large, obsolete, dot matrix printers.  This is a problem
> because the replacement parts will not be available for much longer.
> So I'm trying to create a program which will capture the fixed width
> text file data and convert as well as sort the data (there are several
> different report types) into a different format which would allow it to
> be printed normally, or viewed on a computer.

Do you have access to the programs that generate these reports?  If so,
its probably a simple fixed format, and you can pull the fields out
with the slice operator (eg name = line[30:40]) -- no regular
expressions necessary.  I've done this in a couple of cases, and its
easy *if* you know exactly what the report format is.

Or, consider using another tool.  I've also used Monarch (a purchased
program) for parsing reports, and its works well on most formats.


More information about the Python-list mailing list