I have a set of flatfiles which have columns delimited by #. How can a particular column be deleted in all the flatfiles. All flatfiles have same number of columns.
$ cat filea
a#b#c
d#e#f
g#h#i
if you have to delete the 2nd column,
$ awk 'BEGIN{FS=OFS="#"}{$2=""}{print}' filea
a##c
d##f
g##i
or
$ awk 'BEGIN{FS=OFS="#"}{$2="";gsub(FS "+",FS)}1' filea
a#c
d#f
g#i
//Jadu
Hi,
Thanks for the reply. Can you please clarify one point. What is "1' at the end of the braces mean.
1 => print
Thanks a lot once again.
Or cut -d '#' -f1,3- file