5

awk gsub

view full story
linux-howto

http://www.unix.com – Hi, I want to print the first column with original value and without any double quotes The output should look like <original column>|<column without quotes> Code: $ cat a.txt "20121023","19301229712","100397" "20121023","19361629712","100778" "20121030A","19361630412","100838" 20121030","19361630412","100915" $ awk -F',' '{fln1=gsub(/\"/,"") $1; print $1"|"fln1}' a.txt 20121023|620121023 20121023|620121023 20121030A|620121030A 20121030|52 (HowTos)