separate features from one column
3
0
Entering edit mode
7.8 years ago
biostarsb ▴ 30

Hi,

I have a column in a file with this format

Gene | transcript | source

I would have separated the 3 so that substituted the tube by tabs With the command

Perl -ne 's / "|" / "\ t" / g' file

but it does not work

ideas ??

Thank you

gene • 1.1k views
ADD COMMENT
1
Entering edit mode
7.8 years ago
tr '|' '\t' < file
ADD COMMENT
0
Entering edit mode

thanks it's work (y)

ADD REPLY
1
Entering edit mode
7.8 years ago

It should be

perl -pe 's/\s+\|\s+/\t/g' file > newfile
ADD COMMENT
0
Entering edit mode
7.8 years ago
st.ph.n ★ 2.7k

sed -i 's/|/ /g' file (control +v, tab to insert tab into command)

ADD COMMENT

Login before adding your answer.

Traffic: 1595 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6