This is a test version of Biostars. For the public version, visit https://www.biostars.org.
separate features from one column

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

3 answers

tr '|' '\t' < file

It should be

perl -pe 's/\s+\|\s+/\t/g' file > newfile

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

Log in to answer this question.