Joins the lines of two files or more

learn more… | top users | synonyms

0
votes
1answer
43 views

Add column to a CSV file as a function of other two columns, one from other file

Here is the situation: a.csv Contains values from some sensors captured every 1 second, the last column is the epoch (they actually looks like 1453998477.044).(*s are the sensors values). Example: ...
1
vote
2answers
74 views

Compare columns from two CSVs and merge on matches

I have two CSV files and am trying to merge them based on the first column in the first file matching the third column in the second file. They lines are not sorted. file1.csv: android,1,2 osx,2,5 ...
0
votes
1answer
34 views

How to paste over column by separate matching column

I have these two files: file1.txt 0 rs3094315 0 0 C T 0 rs12562034 0 0 A G 0 rs3934834 0 0 C T file2.txt Chr,Pos,snp_name 1, 742429,rs3094315 Where the ...
1
vote
3answers
36 views

How to join two files by matching a column with an irregular number of columns?

file1: 0000002|SLM DEV CORP |PO 857 0000003|S TOPPING |APT 19 0000004|JD BROS LTD ...
1
vote
3answers
35 views

vlookup work in awk on linux

Hi I have two files containing data: file1: 4,abc 3,xyz 5,fut 6,gfd file2: gfd,2.3 xyz,4.5 abc,6.7 fut,3.2 i wish to create a file3 as output file using linux scripting commands: 4,6.7 3,4.5 ...
1
vote
2answers
236 views

Failed to join domain: failed to set machine kerberos encryption types: Insufficient access

did someone have this error when try to join CentOS 7 to Active Directory. I tried on a various ways(via cli, gui, tui) and always get same error. Failed to join domain: failed to set machine ...
1
vote
1answer
43 views

How do I print all records in file 1 but note the records that do not match file2?

Is there an easy way to print all lines of a file1 (so that the output has the same number of lines as the input file1) but print a message such as NoMatch where the first entries of file1 does not ...
2
votes
1answer
59 views

Merge and print matching and non matching values between a smaller file and a huge file

I have a relatively small space delimited file which looks like this (but with many columns and rows): file1: Entry1 a b c d And another huge tab delimited file with many duplicated entries per ...
3
votes
2answers
61 views

Print common lines between two files along with their line numbers in those files

I have two files. I want to compare the content of one file with the other one. If there is a matching line between both files then print the line and its line number in each file. Example: File 1: ...
2
votes
2answers
48 views

Combine columns using awk? (Or other suggestions)

I'm trying to be a bit effective and need a script or command solution. Say I make a file with 2 columns, or two files with one column, whichever is easier: AA1 B2 ZZ1 YYY XX1 AA2 B2 ...
0
votes
0answers
60 views

Join, file is not sorted

I have two files whose first lines are File1 Locus_1174 [six columns of numbers] locus_6396 [six columns of numbers] Locus_12135 [six columns of numbers] locus_13689 [six columns of ...
1
vote
1answer
43 views

Join is not joining appropriately

I'm trying to join the two files below: FileA.txt: ABCA1 0 2 ABCA4 3 12 ABCB11 0 4 ABCB4 0 3 ABCC6 0 3 ABCC8 4 33 FileB.txt ABCA4 2 ABCB11 1 Where there isn't a match ...
1
vote
1answer
47 views

Comapring columns in 2 files and printing the values that differ

I have a file (file-1) that looks like this, DIP-10097N|refseq:NP_416170|uniprotkb:P30015 DIP-10117N|refseq:NP_414973|uniprotkb:P08177 DIP-10168N|refseq:NP_418766|uniprotkb:P15005 ...
1
vote
1answer
51 views

Find multiple matches in a tabular file and print second column?

I have a tabular file like this which is my index: a X001 a X002 a X003 b X002 c X006 z X007 z X008 z X001 I want to search the following single column file against that index and ...
-2
votes
3answers
41 views

Merging two files [duplicate]

I would like to merge two files. file1 C 45 897 E 76 348 G 78 456 file 2 A 54 987 B 34 986 C 67 340 E 46 987 F ...
3
votes
2answers
58 views

Join (large) files on alphanumeric pattern

I have: File 1 like: sting_of_printable_characters*sting_of_printable_characters*sting_of_printable_characters*ALPHANUMERIC_PATTERN File 2 like: sting_of_printable_characters*ALPHANUMERIC_PATTERN ...
1
vote
1answer
36 views

how to merge two files based on single column

I would like to merge two files. I looked upon the previous questions and answers but none of them matches my desired output. There are two csv files - file1.csv, file2.csv. file1.csv and file2.csv ...
0
votes
1answer
39 views

Finding Matches between two columns of different files and printing it out a different column

I was trying to figure out how to see if there were any matches between column 2 of file1 and column 6 of file2. If so, I wanted that match printed along with the respective string in column 14 of ...
-1
votes
2answers
52 views

how to run a command in many files by running the command only one time?

I would like to run following command on 31 separated file name chr1.txt ... chr31.txt , and get 31 outputs only by one run. this is command : cat input.txt | sed 's/.\{5\}/& /g' > ...
-1
votes
2answers
43 views

combine two file data having same column 1 but different col 2 values [duplicate]

Need to combine two file data having same column 1 but different column 2 values. One file has data: AP 3492 BJ 4995 GJ 3810 MH 5800 UK ...
2
votes
5answers
142 views

compare data in two files one has 2 column while other has 3 column

I have two files: File 1: Chromosome Position Chr1 5242097 Chr1 4876397 Chr1 9474943 Chr1 8494518 Chr1 39872693 Chr1 9445153 Chr1 23044399 Chr1 8018859 Chr1 9474943 Chr1 ...
0
votes
2answers
51 views

Replace values on the basis of matching ID variable

I have two files. file1 has 6 columns, file2 has 2 columns. I want to replace the values in the 6th column of file1 by the values in column 2 of file2, based on matching ID variables (column 1 in both ...
2
votes
2answers
95 views

How can I compare two files and create another file that aren't in first file?

file1 contains: 100 200 300 400 file2 contains: 500 600 700 200 300 Expected output file will be: 500 600 700
2
votes
1answer
101 views

Merge text files with 1st column and difference in output file

File 1: (text1.txt) Row_Added_Ts Count 01/01/14 2022448 02/01/14 8345155 03/01/14 8663852 04/01/14 6785739 05/01/14 5279913 File 2: ...
2
votes
1answer
70 views

Merge lines with matching first column

I've been trying to use awk to merge two files when they have the same first column. Here are my example files: FileA.txt A2M 1 A4GALT 11 AAAS 35 AAGAB 7 FileB.txt A4GALT 2 AAAS ...
2
votes
1answer
126 views

Compare 1st Column in 2 Files and Replace 3rd Column of File 1 with 4th Column of File 2

I have a requirement of comparing the first column between 2 pipe delimited files and if they match, I need to replace the 3rd Column in File 1 with 4th Column in File 2. File 1: 111|xyz|23345 ...
4
votes
2answers
166 views

Adding column based on matching of second column

I have two files. The first file has the following format: 10D0325 2465 0 0 -9 -9 10D0598 2567 0 0 -9 -9 10D0562 2673 0 0 -9 -9 10D0175 2457 0 0 -9 -9 10D0241 2209 0 0 -9 -9 10D0954 2312 0 0 -9 -9 ...
0
votes
2answers
550 views

Bash to join column from multiple files

I have around 20 files in different folders for which I have created a separate file containing path information called pathtofiles.in; /home/users/gray_wolf/unix/File_1.tsv ...
2
votes
1answer
140 views

combine two files to single file with combined columns

I am new to linux/unix shell scripting and struggling to combine two files into a single file with all columns from both files. I am providing my example files. File 1 chr loc T1 C1 chr1 100 2 ...
3
votes
3answers
771 views

comparing the first column of two files and printing the entire row of the second file if the first columns match

I have two files in these formats: file1 : air smell hand dude road cat file 2: air,4,21,01,13,3,2 smell,21,4,2,5,6 dude,1,31,42,1 road,1,4,2,1,4 cat,1,5,6,3,1 hand,1,4,2,1,6 mouse,1,3,5,6,2 ...
1
vote
1answer
134 views

Joining all mp3 links in m3u file into a single mp3 file

I have an m3u file, which has links to many mp3 files online. When I play this m3u file in a player such as vlc, it works fine as long as the internet connection is good. My question is, what's a ...
2
votes
3answers
159 views

compare multiple files(more than two) with two different columns

I have four different files: file1, file2, file3, file4. Each file has 2 different columns separated by tab. I want to match first column of file1 (as reference) with the first column of second file, ...
1
vote
2answers
40 views

Using join with space in key

I'm having issues merging two files using the join command: The first file is a csv file: NAIN GENIEU 01/01/1900,A,B NAIN GENIEUR 01/01/1917,C,D NAINGENIEUR 21/01/1917,E,F The second file contains ...
4
votes
4answers
561 views

Merge two files

I have this file1.txt deiauk 9 kespaul 8 luktol 7 titkur 6 and other file2.txt kespaul b deiauk a And I want to merge both files in one by first value, so my result should be deiauk 9 a ...
4
votes
2answers
103 views

Awk: compare two files

I have a file1.txt USA Joe 123.123.123 Russia Marry 458.786.892 Canada Greg 151.844.165 Latvia Grace 125.895.688 and file2.txt 1 123.123.123 2 151.844.165 3 465.879.515 and I want to create a ...
3
votes
5answers
405 views

source multiple files and output one file

I have a file name "conf1" containing variables like: name='john' last='' custom='1000' and another file name conf2 like this: name='john' last='star' I want to merge between them to one file ...
0
votes
1answer
110 views

need help merging two Unix files

I have 2 pipe delimited files say file1 and file2. Where file1 has say 33 columns and file2 may have 34/35/36 columns. So let's not consider how many columns we have. What I want to do is compare the ...
1
vote
1answer
112 views

How to merge two files in the same row?

I have two files. file1: Dave 734.838.9800 Bob 313.123.4567 Carol 248.344.5576 Mary 313.449.1390 Ted 248.496.2204 Alice 616.556.4458 file2: Bob Tuesday Carol Monday Ted Sunday ...
1
vote
0answers
39 views

Unix : Merge the contents of two files using common key present in the files [duplicate]

Objective : Merge the contents of two files using common key present in the files file1.txt ========= key1 11 key2 12 key3 13 file2.txt ========= key2 22 key3 23 key4 24 key5 25 ...
2
votes
4answers
321 views

Why isn't this awk command doing a full outer join?

Objective: Merge the contents of two files using common key present in the files file1.txt ========= key1 11 key2 12 key3 13 file2.txt ========= key2 22 key3 23 key4 24 key5 ...
2
votes
1answer
428 views

Awk sum csv columns based on fields

I have N files like so: file1.txt Header1,Header2,Header3,Header4,Header5 A,B,RANDOM,1,2 C,D,RANDOM,3,4 fileN.txt Header1,Header2,Header3,Header4,Header5 A,B,RANDOM,1,2 C,D,RANDOM,3,4 They all ...
7
votes
4answers
340 views

Matching and pasting to line

So I have 2 very big text files, consisting of lines like so: First: Robert:Dillain:Other:Other:Other Julian:Brude:Other:Other:Other Megan:Flikk:Other:Other:Other Samantha:Minot:Other:Other:Other ...
0
votes
3answers
54 views

Split the file comparing two fields in the files

Have two files which need to compare the first two columns. Sample input file1: |CID|SID|order|orderdate|confirmdate |151244127820|7177638911583| 2|2015-02-04 07:14:44|2015-02-04 07:15:32 ...
1
vote
1answer
782 views

Awk compare 2 files, print match together with non match lines filled with 0

I have two files. I want to match the 1st column of first file to 1st column of second file. If there is a match I'd like to print the 2st column of second file, if not 0. I have tried awk (awk ...
3
votes
2answers
554 views

Merge some tab-delimited files

I have 100 files with 57,816 rows each.I want to do an outer join of these files by merging on basis of the common column. I am using R programming for this but this is very slow. fileList <- ...
5
votes
2answers
88 views

Merging/Combining 2 text files according to numeric field

I have 2 text files file_1: 14595|Age 35|Salary xx|Position ax|2013|Info 1|Info 2|Info 3|Info 4|Info 5 14649|Age 30|Salary xx|Position az|2015|Info 1|Info 2|Info 3|Info 4|Info 5 file_2: ...
3
votes
1answer
48 views

comparing 2 lists with additional data to be printed

I have a file lets say file1.txt ENSG00000223116 AL157931.1 ENSG00000233440 HMGA1P6 ENSG00000207157 RNY3P4 ENSG00000229483 LINC00362 ENSG00000252952 RNU6-58P I have another file say ...
1
vote
2answers
112 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
97 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 ...
2
votes
3answers
2k views

using awk command to compare the two files and print all the columns then missing display as NA

File 1: 123, 234 345, 789 678, 900 File 2 123, abc 345, dnc Desired output (all columns in file1 and missing value in file two as NA): 123,234,abc 345,789,dnc 678,900,NA