UNIX Changing field separators?

Mashed Potato

Senior member
Feb 3, 2005
213
0
0
A file was made using ! as the field separator, what command would I use to change it? i tried sort -t : "filename" but that did nothing. I also tried awk -F : '{print $1, $3} "filename" and i get an error which says syntax error near line one, bailing out near line one.

-Thanks in advance

Mashed Potato
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
I donno.

How about:

cat filename | tr \! \,

For changing it to comma deliminated.

or maybe
cat filename| awk '{FS="!"} {print $2","$3}'

If you only want certain values.