Any help is greatly appreciated!!
I have an input text file (test_input.txt) that is comma del., and I need to make a substitution in $20 of this file, and write out the entire file after the text is substituted.
I have the following command:
awk -F, '{print $0}' test_input.txt | awk -F, {if ($20 = ".=FOLK:SHPD=.") sub (/=FOLK:SHPD=/, ",", $20) else sub (/" "/, ",", $20) ;} > test_output.txt
1) I want to input the entire file (test_input.txt)
2) if $20 has a ".=FOLK:SHPD=." I want to replace the =FOLK:SHPD= text with a comma (,) and keep the surrounding text as it is. If it doesn't have that text in $20, it should contain " " at which point I want to insert a comma (,).
Any help would be greatly appreciated.
Thanks,
M
I have an input text file (test_input.txt) that is comma del., and I need to make a substitution in $20 of this file, and write out the entire file after the text is substituted.
I have the following command:
awk -F, '{print $0}' test_input.txt | awk -F, {if ($20 = ".=FOLK:SHPD=.") sub (/=FOLK:SHPD=/, ",", $20) else sub (/" "/, ",", $20) ;} > test_output.txt
1) I want to input the entire file (test_input.txt)
2) if $20 has a ".=FOLK:SHPD=." I want to replace the =FOLK:SHPD= text with a comma (,) and keep the surrounding text as it is. If it doesn't have that text in $20, it should contain " " at which point I want to insert a comma (,).
Any help would be greatly appreciated.
Thanks,
M