Search Results

Search: Posts Made By: BioBing
8,546
Posted By Aia
Since gi and ref seems to be always there,...
Since gi and ref seems to be always there, perhaps another suggestion:
perl -pe 's/\|?(?:\s+gi|ref)?\|\s*/\t/g' file

Output:

TRINITY_DN17272_c0_g1_i1 242003970 XP_002422928.1 ...
8,546
Posted By rbatte1
If you columns are fixed, then perhaps you...
If you columns are fixed, then perhaps you could:-tab=$(printf "\t")
tr '|' "$tab" < input_file | cut -d "$tab" -f1,3,5,7-

Does that help? What I'm trying is to convert every | to a tab and then...
8,546
Posted By Aia
Hi Corona688, The OP requires more than just...
Hi Corona688,

The OP requires more than just substituting every pipe symbol for a tab.
8,546
Posted By Corona688
A less brute-force method: tr '|' '\t' < infile...
A less brute-force method:
tr '|' '\t' < infile > outfile
8,546
Posted By Aia
perl -pae '$F[1] = join "\t", (split /\|/,...
perl -pae '$F[1] = join "\t", (split /\|/, $F[1])[1,3] and $_ = join "\t", @F' BioBing.example
8,546
Posted By RudiC
Your target field separator is not clear - do you...
Your target field separator is not clear - do you want the two elements to be each a field of its own with a <TAB> between them, or both making up one field, separated by a space or two?
For the...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 03:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy