unix - remove colon and - between numbers -


i have file this:

chr1:34610-36081          1.20286 chr1:69090-70008          0.0392553 chr1:321083-321115        0 chr1:321145-321207        85.0555 chr1:367658-368597        0.114414 

and want convert in to:

chr1 34610 36081          1.20286 chr1 69090 70008          0.0392553 chr1 321083 321115        0 chr1 321145 321207        85.0555 chr1 367658 368597        0.114414 

i can remove colon cant create space between them

cut -d: -f1,2 file | sed s/\:/\/g 

simplest solution sed:

$ sed 's/[:-]/ /g' file chr1 34610 36081          1.20286 chr1 69090 70008          0.0392553 chr1 321083 321115        0 chr1 321145 321207        85.0555 chr1 367658 368597        0.114414 

to store changes file can use -i option:

$ sed -i 's/[:-]/ /g' file 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -