The beginning of every record looks like this: MSUBUGA JIMSON
P O BOX 21273
GABORONE
(Obviously they are all different, but always have 3 values on 3 lines.)
The end looks like this:
P107.17 P0.00 P225.08 P0.00 P332.25
(The numbers always vary, but there are always 5)
So each record is 4 lines total (with only 3 lines we care about).
Can you give an small snippet of a file with at least two records for example? I envision either simply taking every 4 lines and parsing out the relevant info, or if there is a blank line between each record, just split at the blank lines.
If you read the file in with
readlines() , using index slicing you can easily grab groups of lines.
Reputation Points: 355
Solved Threads: 292
Veteran Poster
Offline 1,102 posts
since Jul 2008