Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [merge]

Merging is the operation of taking two or more source contents to produce a single one. Things that are commonly merged are files (source code, configuration, etc.), branches in a version control system, redundant entries in databases, etc.

2
votes
1answer
51 views

Does sort --unique -k drop duplicates in original order?

I'm doing a unique sort on a concatenated set of index files where the first column will sometimes change between each index and the second column will be a key value (actually hex addresses). Each ...
1
vote
1answer
17 views

How can I merge two sorted named pipes with uneven sizes?

My question is similar to "Merge two sorted files based on sorting values in the same field" but extending it to named pipes. Say I have two text files with sorted integers and I want to merge them. ...
1
vote
2answers
34 views

Merging csv files with Key columns

I need to write a shell script to merge csv files. Both the files have same columns with fixed number of columns designated as "Keys". If the Keys are same, then I want to merge them by adding the non ...
0
votes
0answers
17 views

Centralized application logging that combines matching log lines to a single output [migrated]

We have a solution where we have multiple data centers and per data center we have multiple servers with the same application. The application is handling stateless traffic and produces a lot of ...
1
vote
0answers
55 views

How do I merge identically named files?

My question is similar to this one but the answers don't address how I would like to solve it in my case: Background: I have two computers generating experimental results that are filed in ...
1
vote
2answers
42 views

Merging two files using matching characters

File1: X X P X N X Q File2: P 1 N 5 Q 0 Desired output: X 0 X 0 P 1 X 0 N 5 X 0 Q 0 I have tried a lot of ways using merge command on bash. I couldn't make it work.
1
vote
0answers
29 views

merge commands for line-by-line interactive merging with sdiff, in MacOS unix. Is there a working version?

On MacOS, the sdiff command is described as able to do line-by-line interactive merging, and lists several merge commands for the latest chunk. e.g. sdiff -o mergefile fileleft fileright The single ...
0
votes
0answers
13 views

Merge multiple files with different extensions using a loop in bash script [duplicate]

I have 100's of files of the form filename.0 filename.1 filename.2 filename.3 And they all have identical layouts which I want to merge together into one file using a loop in my bash script, I have ...
1
vote
1answer
1k views

merge txt files with similar name

I have thousands of .txt files in directory. Their names are: ch14.ta_20452_206652_15-84.txt ch14.ta_20452_206652_786-14.txt ch14.ta_20452_206652_77-85.txt ch14.ta_20452_206652_81-78.txt ch2....
4
votes
3answers
219 views

How to merge pre-sorted files into a single BIG file, without excessive memory or temporary disk use

I'm trying to sort (and ideally remove duplicate lines) from a 1.4TB file. Splitting and sorting the individual chunks is not an issue, but reassembling them is turning out to be a challenge. I ...
21
votes
2answers
78k views

How to exit a git merge asking for commit message?

I'm using git. I did a normal merge, but it keeps asking this: # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic ...
0
votes
3answers
852 views

How to merge two csv files with common but differently ordered headers?

I have multiple files (>150) with multiple columns (>150). Most of the headers are common but occur in different order (as eg below): File 1: Col1 Col2 Col3 Col4 Col5 A B C D E File 2: ...
4
votes
4answers
166 views

Compare lines and upgrade two different files

I have a couple of text files with the following features: $ cat file_1 Line A Line B Line C Line D $ cat file_2 Line A Line added 1 Line B Line D Line added 2 They are such that file_1 has some ...
1
vote
1answer
125 views

Join two tables based on non-sharing values in chosen column

I have been using "Perl for biologists with little computer coding knowledge" from site called Scriptome (Harvard). It gives great Perl one-liners to achieve desired functions which runs on Unix ...
1
vote
2answers
3k views

Merge three .gif animations

I have 3 .gifs animations and I just want to merge them temporally. Say g1.gif contains images 1,2,3 sequenced as so g2.gif contains images 4,5,6 sequenced as so g3.gif contains images 7,8,9 ...
5
votes
1answer
177 views

Command-line diff tool

So we all have the diff command installed by default. I certainly don't know how to use it well. But I would expect some reasonable default usage. But when I type diff file1 file2 I get ... a text ... ...
0
votes
1answer
125 views

Merging PDF files with similar names

I have a folder populated with PDF files in this format: SI-T-xxxxxx.pdf SI-T-xxxxxx-sol.pdf SI-T-yyyyyy.pdf SI-T-yyyyyy-sol.pdf and so forth, with the middle part being digits. I want a way for ...
4
votes
4answers
194 views

Stack data from multiple delimited files into one, with variable columns

I'm new to scripting. Got struck with a file merge issue in Unix. Was looking for some direction and stumbled upon this site. I saw many great posts and replies but couldn't find a solution to my ...
0
votes
2answers
88 views

Interleave seven fastQ files

I have 7 FastQ files and I want to merge them into one in the following way: File1 line1 File1 line2 File1 line3 File1 line4 File2 line1 File2 line2 File2 line3 File2 line4 File3 line1 File3 line2 ...
-2
votes
1answer
927 views

How to create a script that merges two files to get a specific output in the korn shell? [duplicate]

I'm currently working on trying to merge two files together on unix first file: Tom 313.455.6786 Deena 313.899.7400 Will 313.845.5633 Nancy 313.676.9445 Kelly 313.611.4242 John 313.908.3858 second ...
1
vote
2answers
626 views

Joining two csv files on common column and removing the second last column

I have two csv files: file1: C1, 1, 0, 1, 0, 1 C2, 1, 0, 1, 1, 0 C3, 0, 0, 1, 1, 0 file2: C3, 1.2 C1, 2.3 C2, 1.8 I want to merge these two files based on C column (which produces): C1, 1, 0, 1, ...
0
votes
2answers
57 views

Joining two space-separated files based on matching values in two different columns

I have tried various solutions given in this site for this kind of problem and none of these are helping me out. I have two files (space-separated, contains columns). Both the files contain the same ...
17
votes
7answers
26k views

how to use patch and diff to merge two files

I have read about diff and patch but I can't figure out how to apply what I need. I guess its pretty simple, so to show my problem take these two files: a.xml <resources> <color name="...
1
vote
3answers
93 views

Merging in Unix

I have a CSV file with vertical bars (|) as the delimiter, like below, for which I need to apply merging technique in Unix. The file contains hundreds of thousands of records (four fields), but I gave ...
1
vote
2answers
43 views

How to merge different columns in the same file?

I have three files, as shown below: FILE 1: DATE PGTO_CRED 20180801 50.00 20180802 150.00 20180803 130.00 20180804 110.00 20180805 200.00 FILE 2: DATE PGTO_TOTAL 20180801 ...
1
vote
1answer
218 views

Awk for merging multiple files with common column

I have a question concerning awk command in unix to merge multiple tables with a common value Tab1 Geneid Chr Start End Strand Length Sample_1 ENSG00000278267 1 17369 17436 - 68 0 ...
3
votes
1answer
128 views

Merge 2 huge files matching multiple columns and preserving the order (print matching and non-matching values) - scale up from awk

I'm having trouble with merging data from 2 files. It is genetic data with chromosome, position, reference and alternate alleles and I need to merge the files by matching all 4 of those columns - with ...
2
votes
3answers
84 views

Merge columns and add

I have a file with the following content (there are additional spaces to pad the first column) 1 account1 192.168.0.1 1 account1 192.168.0.2 19 account2 192.168.0.1 100 account3 192.168....
2
votes
2answers
60 views

Fetching, merging and exporting data from CURL

Before anything else, english isn't my laguage. I'll try to be understandable :-) Second, I am not a regular Linux user, I'm just starting out. I'm using curl and the API of a web chat platform to ...
0
votes
0answers
81 views

Merge fdf file into pdf (output of skim pdf for OS X)

The skim PDF viewer for OS X saves its annotations as .fdf files. Is there any way to merge these into a common pdf document? The closest that might have worked is pdftk: pdftk doc.pdf fill_form ...
1
vote
2answers
3k views

Merge files based on matching of first column

I have two files: File1 ARS-BFGL-BAC-10975 0.9303 688423261 1 01/04/2015 0.9983763305 ARS-BFGL-BAC-11025 0.9092 688423261 1 01/04/2015 0.9983763305 ARS-BFGL-BAC-11044 0.9626 688423261 2 01/04/2015 0....
0
votes
1answer
40 views

merging files with the same 1 column

I have multiple files named p1.bbmap.mapping.csv, p2.bbmap.mapping.csv, p3.bbmap.mapping.csv ... p3.bbmap.mapping.csv Each file has two columns. p1_60_length_504_cov_1.580902 12 ...
1
vote
1answer
116 views

Git not creating merge commit when merging signed/annotated tag

I'm expecting Git to create a merge commit when I merge a signed or annotated tag but instead it fast-forwards the branch pointer. I'm using Git version 2.17.0 on openSUSE Tumbleweed that comes with ...
0
votes
3answers
2k views

How to concatenate files from different sub-directories?

I have a large folder containing many sub-directories each holding many .txt files. I want to concatenate all of these files into one .txt file. I am able to do it for each of the sub-directories with ...
0
votes
1answer
272 views

Mount and merge folder contents

Is there any way to mount a folder content inside to another one? Let's say I have 2 folders with following content; Folder1 Folder2 file1 file2 I basically want to make visible all ...
2
votes
1answer
2k views

concatenating multiple fastq files

I have a folder with almost 100 files, organized in groups of 16 files each. I need to concatenate each of the 16 files of each group into a single file. For example, one group of file names is: ...
0
votes
1answer
675 views

How to merge two gz files into new outputfile with specific name

I have 96 *fastqc.gz raw read files from 24 samples. Each sample was sequenced on two lanees for each pair. I would like to merge reads for each pair from both lanes into one output file with same ...
1
vote
0answers
206 views

socat to merge TCP streams

I'm trying to merge 2 TCP streams into one and then send the result outside through a TCP port server. The first part is Ok, I'm able to capture incoming streams as below: STREAM1: socat TCP:127.0.0....
0
votes
1answer
40 views

simple merge of CSV file

I want to merge two CSV without any condition and no primary.It should be first row file1 and file2. file1 id,name,city file2 mobileno,address,email output id,name,city,mobileno,address,,...
0
votes
3answers
848 views

Combine multiple .csv files with different lengths in a single one

I have a similar problem as Merging contents of multiple .csv files into single .csv file but for different length of csv files. What should I add to the perl script in this answer, in order to ...
0
votes
1answer
61 views

Merging columns from 200+ big files into one table

I have 200+ large files that all have exactly 1 column and 76M rows. I want to start a newfile.txt and slap the columns next to each other (match Line 1 of File 1 with Line 1 of File 2... and continue ...
-2
votes
1answer
97 views

Merging 2 file vertically sorted

I want to merge two files of desired output. File 1 example as below: LOCATION 0 X 0 VALUE 1 2 3 VALUE 1 2 3 VALUE 1 2 3 LOCATION 1 X 0 VALUE 1 2 3 VALUE 1 2 3 VALUE 1 2 3 LOCATION 2 X 0 VALUE 1 2 3 ...
1
vote
2answers
314 views

How to merge two /etc/group files

I have two files in style of /etc/group : root:x:0: daemon:x:1: bin:x:2: sys:x:3: adm:x:4:username tty:x:5: disk:x:6: lp:x:7: mail:x:8: news:x:9: ubuntu:x:999: And I want to merge them into a third ...
2
votes
3answers
4k views

scp remote file and append to local file

I have multiple files to be pulled from remote server. For further processing of the files in the local server, I need to merge (concatenate) them into single file, which can't be done in the remote ...
10
votes
4answers
4k views

How can I merge pdf files so that each file begins on an odd page number?

I need to merge a few dozed pdfs, and i want all of the input pdfs to start on an odd page in the output pdf. Example: A.pdf has 3 pages, B.pdf has 4 pages. I don't want my output to have 7 pages. ...
0
votes
0answers
616 views

Merge/combine two monitors into one desktop

I'm running Arch Linux on a PC with a ATI HD 5870, using the open source driver. I have two HD-monitors and I want to "merge" these screens into one large desktop (3840x1080), so I can run a ...
1
vote
2answers
363 views

How to merge two files with different lengths and columns linux

I have 2 files with different columns and length and I want to merge them as desired output file given below, Please Help!!! File 1 aa bb cc dd File 2 ff , 2 , tg12 dd , 3 , tg13 gg , 4 , tg14 hh ,...
3
votes
1answer
116 views

merging files in a one dataframe

I have almost 160 txt files, each file has 7 columns and now i want to put that in one file. Each files 1st and 6th column data (Geneid, Length) is same so i just want that to be the 1st and 2nd ...
0
votes
2answers
78 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 ...
4
votes
1answer
2k views

Join two files based on a column

file1: a, 1 b, 5 c, 2 f, 7 file2: a, 2 f, 9 g, 3 I want to join file 1 and file 2 based on column 1 and get file 3 as below. file3: a, 1, 2 b, 5, - c, 2, - f, 7, ...