I have some file like this :
abc 123
abc 789
bcd 456
acb 135
I would like to print first column of next line in current line.
Desired output:
abc 123 abc
abc 789 bcd
bcd 456 acb
acb 135
I prefer to use awk.
awktext processing
I have some file like this :
abc 123
abc 789
bcd 456
acb 135
I would like to print first column of next line in current line.
Desired output:
abc 123 abc
abc 789 bcd
bcd 456 acb
acb 135
I prefer to use awk.
Best Answer
Memorise the previous line:
This processes the input as follows:
prev
, see the next step) and the first field of the current line, separated by the output field separator (the space character by default);prev
variable;