Unix fold command in python

dean diabolik at uku.co.uk
Mon Jun 14 12:50:06 CEST 2004


Hello Group:

Hopefully someone can answer my question. 

I have a unix shell command that I would like to emulate in python. I
am sanning a file that contains a stream of data with a record size of
242 bytes but no record delimiters. There are multiple fields in each
record that can be mapped according to their position:

example

field1 byte 0-4 
field2 byte 5-8

How do I make python read a record in and report the contents of a
particular field (and may be carry out an operations with that field).

Much appreciated

regards

dean



More information about the Python-list mailing list