I am trying to merge data from two text files. One file (File1) contains a listing of data which includes the trial number in Column 5, while the other text file (File2) contains what category the trial belongs to.
Here is a snippet of what File1 looks like.
And here is a snippet of what File2 looks like:
In other words, for all of Trial 1 (i.e., the first two snippet lines of File1) belong to the category "Gamble", all of Trial 2 (i.e., the last two snippet lines of File2) belong to the category "SureThing", and so on.
What I want to do is merge the two, so that an additional column is created in File1 that lists the category membership for each trial. So, my output should look as follows:
Any help or nudges in the right direction would be greatly appreciated. Thanks!
-Jahn
Last edited by radoulov; 04-24-2011 at 05:28 PM..
Reason: Code tags, please!
Hey everybody,
I am new here and already a question to ask, I just recently started some bioinformatic work for my PhD so I am slowly learning
Anyway, here is my problem, I have two text files, one contains the complete data file with 43000 genes and their read counts for all my samples... (1 Reply)
Hi,
I have two text files that I would like to merge/join. I would like to join them if the first columns of both text files match and the second column of the first text file matches the third column of the second text file.
Example input:
First file:
1334 10 0 0 1 5.2
1334 12 0 0 1 4.5... (4 Replies)
I have two text files. One has two columns and looks like below:
rs# otherallele_freq
rs10399749 0
rs4030303 0
rs4030300 0
rs940550 1.000
rs13328714 0
rs11490937 0
rs6683466 0
rs12025928 1.000
rs6650104 0
rs11240781 0... (5 Replies)
So I have two text files. The first one looks like this:
refsnp_id chr_name chrom_start
1 rs1000000 12 126890980
2 rs10000010 4 21618674
3 rs10000012 4 1357325
4 rs10000013 4 37225069
5 rs1000002 3 183635768
And the second one looks like this:
AUC rs1000000 0.03 0.1240
AUC ... (4 Replies)
Hi All,
I have two text files containing space delimited columns. The first file contains 9 columns and the second one contain 3 columns. I want to copy the 3 coloumns from the 2nd file and paste them in 1st file after 9 coloumns.
Ex.
File1.txt contains 9 coloumns
C1 C2 C3 C4 C5 C6 C7 C8 C9... (6 Replies)
Hi good day
Is there a shell script I can use to join multiple text files in a folder and put the name(excluding the extension) of the text file before it's contents and put EOF at the end of each portion.
so for example, say I have
file1.dat, file2.dat, file3.dat
i'll get
file1
{text... (7 Replies)
Hi guru's :)
I am new to UNIX. requirement is merging all text files from one folder in the order which they have received.
EX: under /Test folder files received in certain intervals.
abc.txt @ 1:00 AM
123.txt @ 2:00 AM
xyz.txt @ 4:00 AM
.
.
.
456.txt @ 10:00 PM
... (4 Replies)
Hi There,
I am new to UNIX. requirement is merging all text files from one folder in the order which they have received.
EX: under /Test folder files received in certain intervals.
abc.txt @ 1:00 AM
123.txt @ 2:00 AM
xyz.txt @ 4:00 AM
.
.
.
456.txt @ 10:00 PM
so need to develop a... (3 Replies)
hi
i need to select a few columns of two txt files and write it to a new file. there is one common field for both of these files.
plz help me in this
thanks in advance (4 Replies)