Parsing a file

Hi,

I have a file that looks like this:

36-:<4,535730,2>
101-:<4,636445,2>
150-:<1,375774,0>
258+:<1,28498,1>

I want to parse it so they it will look like this (tab-delimited):

36  -  4  535730  2
101  -  4  636445  2  
150  -  1  375774  0 
258  +  1  28498  1 

I tried replacing the values that I dont want with a tab but its very tedious.

any help would be appreciated.

thanks

Phil

Try:

sed -e 's/\(.*\)\(.\)\:\<\(.*\),\(.*\),\(.*\)\>/\1 \2 \3 \4 \5/' infile

The \1 \2 \3 \4 \5 are seperated with tab.

Output:

36      -       4       535730  2
101     -       4       636445  2
150     -       1       375774  0
258     +       1       28498   1
nawk -F'[:<>,]' '{sub(".$",OFS "&", $1);print}' OFS='\t'' myFile