I have a log from a parallel machine where for each job there are 2 lines: one corresponding to its start (contains
a field START) and one corresp. to its end (has a STOP).
They have a common field, the job id.
What I'm trying to do is to concatenate (part of) the STOP
line to its corresponding START line.
i thought that I should read all the STOP lines in an array and then parse the file again to find the matching start line, based on the job id.
What I would like to ask is:
1) with this solution i have to parse the huge file twice and at least parts of the array containing the STOp lines
for each START line. Is there any simple solution to my
problem using awk?
2)How can I refer to just one field from each line stored in the array? I thought I should use split, but I couldn't find any example which would select just a field from each
element of the array. ( array[j] would refer to the entire line, would array[j][k] work? )
I would highly appreciate any helpful hint!!!
Thanks a lot.
Anna
a field START) and one corresp. to its end (has a STOP).
They have a common field, the job id.
What I'm trying to do is to concatenate (part of) the STOP
line to its corresponding START line.
i thought that I should read all the STOP lines in an array and then parse the file again to find the matching start line, based on the job id.
What I would like to ask is:
1) with this solution i have to parse the huge file twice and at least parts of the array containing the STOp lines
for each START line. Is there any simple solution to my
problem using awk?
2)How can I refer to just one field from each line stored in the array? I thought I should use split, but I couldn't find any example which would select just a field from each
element of the array. ( array[j] would refer to the entire line, would array[j][k] work? )
I would highly appreciate any helpful hint!!!
Thanks a lot.
Anna