removing commas from text file

Dear all

I have a file which looks like this

xxxxxxxxxxxxxx,xxx,xxxxxxxxxx
xxxxxxxxxxxxxx,xxx,xxxxxxxxxx

etc

basically 14 characters then a comma, three characters, then a comma then 10 characters. We are uploading this file to our mainframe and they want the commas removed, so it looks like this

xxxxxxxxxxxxxxxxxxxxxxxxxxx

Has anybody got any ideas on how to do this?. Note, the file will always be the same format, but will vary in the number of lines

Any help would be greatly appreciated

Well, here's one way:

sed -e 's/xxxxxxxxxxxxxx,xxx,xxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxx/' some_file > TMP_00
cp TMP_00 some_file
rm TMP_00

That sed solution will work only if each line literally contains those x's.

To get rid of all commas in a file, change that to:

sed 's/,//g'  some_file  > TMP_00

wow i must be tired.. your solution looks much better perderabo

or you can use the tr command

cat test.txt|tr -d , > out.txt

Have fun!
/Peter

Thanks Guys, that now works

regards

For a bit of fun (mine) the "perl" version is VERY similar to the sed version:

perl -pe 's/,//g;' < some_file > TMP_00