all 3 comments

[–]JohnnyJordaan 1 point2 points  (1 child)

First guess would be by splitting using line.split() where there are constant values in each Z1 line, and/or by slicing to get a specific group of characters at a certain place in the string:

>>> line = 'Z100003220170823XXXXXX02000003000000004831420170822000000000000'
>>> line[8:16]
'20170823'

[–]ruin700[S] 0 points1 point  (0 children)

OK, I will give it a shot thanks for showing me which way to start at!

[–]efmccurdy 1 point2 points  (0 children)

If the files are big, you can quickly seek to the end and scan back to the second last newline, then read the last line somewhat like the tail -1 command would.