Hi list,
I have an awk program that parses a text file which I would like to
rewrite in python. The text file has multi-line records separated by
empty lines and each single-line field has two subfields:
node 10
x -1
y 1
node 11
x -2
y 1
node 12
x -3
y 1
and this I would like to parse into a
Daniel Nogradi wrote:
I have an awk program that parses a text file which I would like to
rewrite in python. The text file has multi-line records separated by
empty lines and each single-line field has two subfields:
node 10
x -1
y 1
node 11
x -2
y 1
node 12
x -3
y 1
and this
I have an awk program that parses a text file which I would like to
rewrite in python. The text file has multi-line records separated by
empty lines and each single-line field has two subfields:
node 10
x -1
y 1
node 11
x -2
y 1
node 12
x -3
y 1
and this I would
Peter Otten, your solution is very nice, it uses groupby splitting on
empty lines, so it doesn't need to read the whole files into memory.
But Daniel Nogradi says:
But the names of the fields (node, x, y) keeps changing from file to
file, even their number is not fixed, sometimes it is (node,