Joins the lines of two files or more

learn more… | top users | synonyms

1
vote
2answers
68 views

Compare and print data from different text files to one in Shell

How can I compare and print data from different text files to one in Shell. I have captures NAS details of three different boxes using SSH, now I need to combine all the three text files to one file ...
0
votes
1answer
30 views

Need to compare the two files and print all the columns then missing display as NA, then join another file [duplicate]

File 1: 123, 234 345, 789 678, 900 File 2 123, abc 345, dnc output (all columns in file1 and missing value in file two as NA): 123,234,abc 345,789,dnc 678,900,NA Output file add with another ...
0
votes
1answer
85 views

How to update files based on another file

I have 4 csv files and I want to update set of three based on values in the other one. The first 2 files (file_1 and file_2) contains names and their numerical ids. The third file (file_3) contains ...
3
votes
2answers
27 views

Output parameter in joining two matrices?

I have to join two matrices. $cat mat1 : sample gen1 gen2 gen3 gen4 pt1 1 4 7 10 pt3 5 5 8 11 pt4 3 6 9 12 $cat ...
2
votes
3answers
51 views

Merging two tables including multiple ocurrence of column identifiers and unique lines

I asked a similar question yesterday (Merging two tables including multiple ocurrence of column identifiers) but ran into a problem with unique lines. I would like to merge two tables based on column ...
4
votes
1answer
45 views

Truncated result returned by JOIN

I'm using join command under linux, but the results vary between different machines. I have two simple files: cat 1.txt a aaa,0.2 b bbb,0.3 c ccc,0.5 cat 2.txt a aaa,0.2 b bbb,0.3 c ccc,0.6 I'm ...
0
votes
1answer
31 views

Compare strings

I have 2 txt files, in one i have alias lists and the other is the servers name. So what im trying to do is to loop from the alias txt file line by line and where it will find the name that is on the ...
1
vote
3answers
151 views

merging all files into one file?

I was trying to merge all the text files in to one file. All the text files has one column and equal number of rows. My data file names are data_1.txt, data_2.txt, data_3.txt, . . . data_n.txt. ...
2
votes
2answers
171 views

Collate tab-delimited files

I want to compare the information from mapping files to retrieve crosslinked information in a tab-delimited file format. For example, one file contains COG0001 882.DVU3168 COG0002 883.DvMF_2502 ...
0
votes
0answers
82 views

Join 2 files on 2 columns returning 0s

I have 2 files, that are sorted, with 3 columns each. I need to merge them based on the first 2 columsn and return 4 columns, being the 2 that are matching and then the 3rd column from each file. I ...
1
vote
2answers
243 views

merge csv files, escape comma inside quotes

I have 3 csv files I want to join by first column (id column) Each file has the same 3 columns Row example : id | timestamp | Name 3792318, 2014-07-15 00:00:00, "A, B" When I join ...
1
vote
2answers
211 views

Merge csv files with conditions

I have 2 CSV files for each date (csv_2014_4_15 and csv_2014_4_16) , with basic structure and couple of unique columns as below. id,name,created_at,updated_at,other columns 12, joe, 2013-1-1 18:30, ...
2
votes
2answers
66 views

Merging files by rows

Is it possible to copy the whole rows of File1 in a new File3 following the instruction given by File2 by using a simple bash script using sed or awk? File1: /*two or more columns*/ AC 456324 DC ...
2
votes
2answers
106 views

Removing lines with a single common field

I have a tab separated file that looks like this: 123 some text 123 some different text 334 some other text 341 more text and I want to do two things. One is to order everything numerically ...
2
votes
2answers
81 views

How can I compare two files based on the value of the first column?

I want to compare two files based on the value of their first column: file1 aaa 23 3 bbb 56 6 ccc 45 2 file2 bbb m a aaa a m ccc m m The output file should be: aaa a m bbb m a ccc m m ...
0
votes
1answer
226 views

merge unsorted file to sorted file using shell command

I want to merge/join or produce a new merged file . Both files contain common IDs in the first column . File 1 looks like this ID Tb927.4.4670 Tb927.8.3630 Tb09.160.4310 Tb927.8.3650 File 2 ...
3
votes
6answers
168 views

How to combine contents of two files having the same value in a column?

File1: 00:00 274 00:04 476 00:05 450 00:06 499 00:07 373 00:08 206 00:09 471 00:10 154 File2: 00:00 183 00:01 60 00:02 344 00:03 540 00:04 450 00:07 348 00:09 473 00:10 203 Desired output: ...
3
votes
5answers
231 views

Join two files, matching on a column, with repetitions

How can I get two files A and B, and out put a result like this: File A: 001 Apple, CA 020 Banana, CN 023 Apple, LA 045 Orange, TT 101 Orange, OS 200 Kiwi, AA File B: 01-Dec-2013 01.664 001 ...
2
votes
2answers
149 views

Join two files with different number of columns and rows

I have two files. file_1.txt looks like this: R1 C1 C2 C3 C4 C5 R2 C1 C2 C3 C4 C5 R3 C1 C2 C3 C4 C5 R4 C1 C2 C3 C4 C5 ...
1
vote
3answers
372 views

Find matches for the 5th columns in a pipe delim files

File 1: Connect|20130320000023|UTC|PPP|test3@test3.co.uk|test1@test1.co.uk|0BCBE578| File 2: Connect|20130320000023|UTC|PPP|test1@test1.co.uk|test1@test1.co.uk|0BCBE578| ...
3
votes
2answers
245 views

Join: Two files - but only append last two columns

Given the files: 1.txt 1, abc, 123, 456, 789 2, lmn, 123, 456, 789 3, pqr, 123, 456, 789 2.txt 1, abc, 123, 000, 000 3, lmn, 123, 000, 000 9, opq, 123, 000, 000 OUTPUT.txt ID, NAME, X, ...
4
votes
4answers
834 views

Joining two files with unique identifier

I have two files with approximately 12900 and 4400 entries respectively, that I want to join. The files contain location information for all landbased weather observing stations around the globe. The ...
1
vote
2answers
360 views

Join command gives incorrect output?

I'm trying to join two simple files in Solaris 5.8 Version as below: ~/temp/s: cat 1 work1 a 8058 51 work2 b 15336 51 ~/temp/s: cat 2 8058 77-11:29:32 /apps/sas 15336 100-12:23:49 /local/hotfix ...
1
vote
1answer
341 views

how to pdfjoin landscape and portrait oriented JPEG images to one PDF file?

I have some JPEG files. Most of them are landscape oriented, but some are portrait oriented. I want to combine them into one big PDF file. I tried pdfjoin but this results in all images beeing ...
2
votes
2answers
458 views

Matching two files for similar first line

I have 2 set of files. File one contains ID's ex: 1111 2222 6666 3333 4444 File two contains ID and username: 1873 Neil 1111 Roger 7632 Tim 3333 Oscar 8723 Greg 4444 Roy 6666 Patrick I want to ...
1
vote
3answers
2k views

strange problem: join: file 2 is not in sorted order

sort flash_int_list.txt|join finish_comm - > t1 join: file 2 is not in sorted order I have sorted flahs_int_list.txt but it still says file 2 is not in sorted order what is wrong ? the ...
2
votes
2answers
165 views

add fields from different files

I have two files A and B with the same number of lines. Each of them has multiple columns. I want to add field 6 in file A with field 3 in file B for each line. e.g.: file A: 2769 RUT10EKl3fY 0 ...
2
votes
1answer
1k views

intersection of two files according to the first column

I have two files in file A, there are sequence_numbers in the other file B, there are many columns, and the first column is sequnce numbers, I want to get a files with all the lines in the B with the ...
1
vote
3answers
190 views

How to sort and join at the same time?

I have 2 files, one having 2 columns, another having 1 column. The second file is sorted using sort -u. Now the task is I need to join this column with the first column of the first file, which is not ...
5
votes
5answers
11k views

join : “File 2 not in sorted order”

I've got two files _jeter3.txt and _jeter1.txt I've checked they are both sorted on the 20th column using sort -c sort -t ' ' -c -k20,20 _jeter3.txt sort -t ' ' -c -k20,20 _jeter1.txt #no ...