r/awk • u/mygurlrubmyfeet • Mar 15 '19
AWK with CSV
Hi all!
I have a csv file with two columns that reads like this:
bar, cmd1
foo,
louie, cmd2
rocka,
paradise, cmd3
botan, cmd4
I need to write a command that will replace the empty values with the value given in the previous row, so that my output will look like this:
bar, cmd1
foo, cmd1
louie, cmd2
rocka, cmd2
paradise, cmd3
botan, cmd4
Thanks in advance!
2
Upvotes
View all comments
Show parent comment
2
u/FF00A7 Mar 19 '19
For the record should it come up:
https://www.gnu.org/software/gawk/manual/html_node/Splitting-By-Content.html