Replace blank spaces with semicolon - text file

Hi all,

Been trying to find a solution to this, I'm sure its a sed 1 liner, but I don't know sed well enough to work it out...

I have a text file in the following format:

              431        666           1332           2665          0.24395
              432        670           1340           2681          0.24544
              433        674           1349           2697          0.24693
              434        678           1357           2714          0.24844
              435        683           1365           2730          0.24995
              436        687           1373           2747          0.25148
              437        691           1382           2763          0.25300
              438        695           1390           2780          0.25454

etc....

there are a number of blank spaces between the columns, and I want to replace these blank spaces so that there is one single semi colon there instead. Any thoughts?

Thanks

Jon

Much easier with awk:

awk '{$1=$1}1' OFS=";" file

there's a number of different ways you can do this, one example is cut/paste
cut f1 file > tmp1; cut f2 file > tmp2; cut f3 file > tmp3; etc etc
paste tmp1 tmp2 tmp3 tmp4 > file
rm -f tmp*

something like that, 'man cut' for more info.

also grep, awk, some cool loops, input field seperator... etc

Franklin, brilliant, thats exactly what I need, thanks!