Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Adding a particular column from one file to a second file

by ZWcarp (Beadle)
on Jul 15, 2011 at 17:09 UTC ( #914658=note: print w/ replies, xml ) Need Help??


in reply to Re: Adding a particular column from one file to a second file
in thread Adding a particular column from one file to a second file

Excellent!! what a useful thing to know. Ok this is probably a dumb question but why is it telling me

join -t '\t' -a1 -1 16 -2 2 PTCL_All.txt Cosmic_Counts_By_Gene.txt join: illegal tab character specification <\code> or <code>join -t '<tab>' -a1 -1 16 -2 2 PTCL_All.txt Cosmic_Counts_By_ +Gene.txt join: illegal tab character specification
Isn't -t ' CHAR' the correct format for specifying the delimiter in the output? Also if I use join  -t ',' -a1 -1 16 -2 2   PTCL_All.txt Cosmic_Counts_By_Gene.txt The output seems to be much more different than just a comma delimeter being added to the command  join   -a1 -1 16 -2 2   PTCL_All.txt Cosmic_Counts_By_Gene.txt Am I doing this correctly? the latter just looks like what I want with spaces separating the columns( the same number of lines as file 1), while the former seems to create a million repeats of each line (many many many more lines than what is in either file).


Comment on Re^2: Adding a particular column from one file to a second file
Select or Download Code
Re^3: Adding a particular column from one file to a second file
by ZWcarp (Beadle) on Jul 15, 2011 at 17:13 UTC
    I think this works though.... join   -a1 -1 16 -2 2   PTCL_All.txt Cosmic_Counts_By_Gene.txt |perl -pe 's/ /\t/g'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://914658]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2014-07-13 12:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (249 votes), past polls