Unix fold command in python
diabolik at uku.co.uk
Mon Jun 14 12:52:41 CEST 2004
Hopefully someone can answer my question.
I have a unix shell command that I would like to emulate in python.
The command is FOLD. I am scanning 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
field1 byte 0-4
field2 byte 5-8
fieldn byte 238-242
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).
More information about the Python-list