Unix/Linux Go Back    


UNIX for Beginners Questions & Answers If you're not sure where to post a Unix or Linux question, post it here. All unix and Linux beginners welcome in this forum!

How to split a column based on |?

UNIX for Beginners Questions & Answers


Tags
cut, split

Reply    
 
Thread Tools Search this Thread Display Modes
    #8  
Old Unix and Linux 1 Week Ago
BioBing BioBing is offline
Registered User
 
Join Date: Jun 2017
Last Activity: 26 June 2017, 4:51 AM EDT
Posts: 2
Thanks: 6
Thanked 0 Times in 0 Posts
Thank you! This worked like a charm!

Quote:
Originally Posted by Aia View Post
Since gi and ref seems to be always there, perhaps another suggestion:

Code:
perl -pe 's/\|?(?:\s+gi|ref)?\|\s*/\t/g' file

Output:

Code:
TRINITY_DN17272_c0_g1_i1        242003970       XP_002422928.1  57.5    127     54      02382     65      191     1.2e-41 176.0

Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Split 1 column into numerous columns based on patterns mmab UNIX for Dummies Questions & Answers 11 10-13-2015 07:33 AM
Split file based on a column/field value galaxy_rocky Shell Programming and Scripting 6 09-01-2014 02:50 AM
awk to sum a column based on duplicate strings in another column and show split totals prashob123 Shell Programming and Scripting 5 01-10-2014 12:39 PM
Split file based on column radius UNIX for Dummies Questions & Answers 10 04-30-2013 10:48 PM
Split the file based on column sol_nov Shell Programming and Scripting 6 01-16-2013 05:41 PM



All times are GMT -4. The time now is 04:39 PM.