#!/usr/bin/gawk -f # /* vim: set filetype=gawk : */ -*- awk -*- BEGIN{ FS = ","; Fname="test"; Out=""; } { Del = 1; $Del = ""; gsub(/ +/,","); gsub(/\t+/,","); gsub(/,,+/,","); } /^,/{ $0 = substr($0,2,length($0)-1); } #/,[^.]/{ # $0 = substr($0,1,length($0)-1); #} { Out= Out $0 "\n"; } END{ print Out>Fname; }