#!/usr/bin/gawk -f #/* vim: set filteype=awk : */ -*- awk -*- # {sub(/\%.*/,"")} # {gsub(/[\'\"]/,"",$0)} # {sub(/\#.*/,"")} # {sub(/\|.*/,"")} BEGIN{FS=","} /^\|.*/ {print $0; next} /^[ \t]*$/ {print $0; next} /^.*\:/ {print $0; next} { temp=$NF for(I=(NF-1); I>0; I--) { $(I+1)=$I } $1=temp for(J=1; J<=NF; J++) { if(J==1){comm=$J} else{comm=comm "," $J} } print comm }