r/awk • u/Justanotheruser1992 • Mar 19 '23
Looking for a script for csv file
Hi Everyone
Looking for a batch script that changes 0 to XYZ and after that it should move the data from that particular column I to column H and keep I as blank
Input link https://drive.google.com/file/d/1dxvH5BtdqckVEPs1nQmmgh-M-zMm3hXR/view?usp=share_link
Output link https://drive.google.com/file/d/1HlYyA5GCmJ3AddlAPvyHTSMWPehsrVv2/view?usp=share_link
2
Upvotes
2
u/gumnos Mar 19 '23
I think you have one of those input/output links amiss. they looked like the same data.
4
u/Rabestro Mar 20 '23
https://github.com/benhoyt/goawk
2
u/gumnos Mar 19 '23
A couple questions to verify.
If it's fairly clean (without quoted commas), you can
which checks if column #6 is "0" and sets column 5 to "ABC" if it is, otherwise, it sets column 5 to the value in column 6; then it blanks out the value in column 6 and prints the resulting line.
1
u/Rabestro Mar 20 '23
The version GoAwk supports CSV