1
Like in the subject. Let say I have a file which contains:
*aaa A B C
D E F 55
*ccc A B C
R E T 33
and I would know if it's possibe to make a statement if $1=="*aaa" then print $4 from next line. I know that one of the solutions could be to convent file to this output:
*aaa A B C D E F 55
*ccc A B C R E T 33
using "*" as line separator, but I would like to avoid this.
Regards, lucas
how can I replace next statement if I'm looking for a value from not the next line but next+1 or the previous line? – lucas – 2013-12-13T20:59:14.870
store all lines in an awk array (actually a hash table). Feel free to upvote or accept answer :) – suspectus – 2013-12-13T21:06:09.123