How can i remove spaces in between the fields in a file

Hey ,

I have a file and it's having spaces for some of the fields in it. Like the one below. I want to remove the spaces in them through out the file. The spaces occur randomly and i can't say which field is having space. So please help. Here is sample file with spaces after 5th field.

tr -d ' ' < oldfile > newfile

To remove trailing spaces for fields you can do something like this (not tested) :

sed 's/ *\|/\|/g' oldfile > newfile

Jean-Pierre.

Both of this works. Thanks guys.