SUM Fields between two lines
Posted: Fri Nov 17, 2017 10:22 pm
Hi,
I am trying to sum the number of occurrences between two lines in a file. For example:
START 00000
FIELD1 00001
FIELD2 00001
END 0000X
With the above input I would like to return something like:
START 00002
I am lost on how to do this with sort. Any help would be appreciated.
I am trying to sum the number of occurrences between two lines in a file. For example:
START 00000
FIELD1 00001
FIELD2 00001
END 0000X
With the above input I would like to return something like:
START 00002
I am lost on how to do this with sort. Any help would be appreciated.