You’re printing the result of the gsub
, but gsub
does an in-place modify of $2
instead of returning a modified copy. Call gsub
, then print:
awk -F\, '{gsub(/[ \t]+$/, "", $2); print $2 ":"}'
You’re printing the result of the gsub
, but gsub
does an in-place modify of $2
instead of returning a modified copy. Call gsub
, then print:
awk -F\, '{gsub(/[ \t]+$/, "", $2); print $2 ":"}'