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.

learn more… | top users | synonyms

24
votes
2answers
1k views

How to merge two text files into one file without using cat or sed [duplicate]

I have two files File1: a b c File2: 1 2 3 now I need to combine them to one csv file a;1 b;2 c;3 As the files are really huge, I would rather not use cat and sed to process the second file. ...
12
votes
3answers
7k views

How do I “merge” two text files?

I recently upgraded from Ubuntu 12.04 to 12.10 and at one point, it encountered an Apache config file conflict in apache2.conf. I didn't give me a merge option at that point, so I just rejected the ...
11
votes
3answers
564 views

Merging two files, one column at a time

I have 2 large files (3000 columns, 15000 rows) of the following format file1 (tab-separated): 1/0 0/0 0/0 0/0 1/1 0/0 1/1 0/1 0/0 file2 (tab-separated): 3 5 2 1 7 10 3 4 3 I'd like to combine ...
10
votes
2answers
6k views

Merging two internet connections from two network interfaces in order to obtain double speed

I have two network interfaces (one wired & one wireless). I have two internet accounts too (each 256 kBps; one from a modem that I use as wired connection & the other from a wireless network). ...
9
votes
7answers
1k views

How to merge text of alphabetic lines with the numeric lines in shell?

I Have a file that has text like this: AAAA BBBB CCCC DDDD 1234 5678 9012 3456 EEEE 7890 etc... And i want to match up the Alphabetic lines with the Numeric lines so they are like this: ...
9
votes
2answers
6k views

Merge folders and replace files using CLI

I want to update some forum software and I'd like to test the upgrade process using CLI as a learning possibility. How do I merge contents of a folder into another folder and replace files?
9
votes
4answers
2k views

how to 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. ...
7
votes
3answers
678 views

merge two files, first line from first file followed by first line from second file [duplicate]

I have two files : f1: f2: ============== =============== some text line 1 A1 some text line 2 ...
7
votes
3answers
73 views

How to prevent cp from merging two identically-named directories?

I have two identically-named directories: $ ls mydir file1 file2 $ ls other/mydir file3 file4 If I copy mydir to other, the two mydirs get merged: $ cp -r mydir other $ ls other/mydir file1 ...
6
votes
6answers
10k 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="...
5
votes
3answers
428 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, 1A,...
4
votes
3answers
301 views

Merge files using zipper method / late merge

I am searching for a nice method of merging two or more files line by line using the zipper method (also called late merge). Assuming we have three files, the result should look like this: line1 ...
4
votes
4answers
4k views

Merge 2 files based on all values of the first column of the first file

I need to merge below 2 files: file1: TABLES REF-IO HEAD-IO DIFF-IO test 200 500 -300 exam 2 3 -1 final 2 1 1 mail 4 2 2 TOTAL 208 506 -298 file2:...
4
votes
2answers
233 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 ...
3
votes
3answers
1k views

Merging content of two files with comparing content of column

I have a problem trying to merge content of two files : file 1 : 873 1.1.1.1 1033 99.99.99.10 1108 78.2.204.174 1257 78.2.8.181 file 2: test1 78.2.8.181 p6 test2 99.99.99.10 p9 test7 1.1.1.1 ...
3
votes
1answer
129 views

Is it possible and how to merge identical files between different snapshots in a btrfs file system?

I regularly use btrfs's snapshot to backup the whole system, but it's redundant to have identical files between different snapshots. Commonly, for example, I took a snapshot of @ as @...
3
votes
2answers
5k views

Merging multiple lines based on column 1

I have a file like below.. abc, 12345 def, text and nos ghi, something else jkl, words and numbers abc, 56345 def, text and nos ghi, something else jkl, words and numbers abc, 15475 def, ...
3
votes
3answers
3k views

How to merge output of two running log files in real-time

I have been analysing how a Linux USB driver works using two disparate methods: examining the output of usbmon, which is a hex dump-ish view of what's being sent "on the wire". adding printk() ...
3
votes
2answers
1k views

merging two column

input_file (columns are tab delimited, only column 4 contains spaces) input A B C D;<>X;<>Y 0 C D E F;<>Z;<>X 1 output A B C D;<>X;<>Y;<>apple=0 C D ...
3
votes
1answer
207 views

Combine parts of pages of a PDF document

I have a PDF which has some content split onto 2 pages. The first part takes less or equal the bottom half of the first page and the second part takes less than the top half of the second page. For ...
3
votes
2answers
71 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 ...
2
votes
2answers
291 views

What scripting language can I use to automate a concatenation & zipping process?

For a project I'm doing I need to concatenate and compress (with zip) many (midi) files and compare their sizes. I've thought there must be some language that allows me to do something like this: ...
2
votes
3answers
3k views

Join, filling in missing key values

I have two files having a primary key value as a first field, and a corresponding value(s) as the remaining fields, and some primary key values are missing in one of them but are present in another, ...
2
votes
1answer
257 views

Using awk, how to get desired output from multiple file sources

I have two files: file1: A,D B,E C,F file2: G,H,I J,K,L Using awk, I want to print: A,D B,E,I C,F,L How can I use awk to achieve this?
2
votes
2answers
275 views

File merging - same name, different extension

How would you merge different input .txt and .tsv files (within a directory) who have the same name but a different extension into an output file? Input: file1.txt, file2.txt, file1.tsv, file2.tsv ...
2
votes
1answer
280 views

Is there a way to define the preferred merge or diff tool under Unix?

I know that you can define the preferred editor by setting the EDITOR environment variable. My question is if there is a similar solution for setting the preferred merge or diff tool.
2
votes
1answer
8k views

How to exit a git merge asking for commit message?

I'm new to 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 ...
2
votes
3answers
1k views

Merging multiple tab-delimited tables based on common columns

I am new to the field and I want to compare and merge 500 hundred tab-delimited files, each with two columns ("Position" and "Poly"). Examples of file1, and file2 (and other files) and the final ...
2
votes
2answers
40 views

Merging 2 files records by template

I am trying to use awk to merge two text files in a rather peculiar way, taking two lines from file1, a group of word(s) from file2 (but placed on a separate line), alternating ad infinitum. Groups ...
2
votes
1answer
201 views

How can I make multiple copies of one folder without merging?

When two or more identically named folders are to be copied into or moved to the same location, the default option either in the GUI file manager, or using in a terminal cp -r --backup=numbered or ...
2
votes
1answer
29 views

Merging specific columns of 2 files based on field match

I know I'm not the first one asking this but my code still does not work: File 1: gi|1283| tRNAscan exon 87020 88058 . - . transcript_id "Parent=tRNA-Tyr5.r01"; gi|3283| tRNAscan exon 97020 97058 . +...
2
votes
0answers
55 views

Combine multiple PSCP commands?

I need to transfer multiple folders from my server to my pc. I'm currently using a command like: pscp -r user@ServerIP:/public_html/folderA "C:\folderA" && pscp -r user@ServerIP:/public_html/...
1
vote
2answers
114 views

Merge 2 files based on all available values of the first column in both files

I need to merge below 2 files: file1: viewer 23 test 27 remark 2 file2: viewer 2990 exam 200 remark 240 merged file should be as shown below: type value1 value2 difference ...
1
vote
2answers
235 views

merging text files into one

I have four text files each containing a single field. I want to convert them into a single text file with four fields (one from each file). How can I do this using shell scripting.
1
vote
1answer
35 views

How to merge pdf file so that each file starts with file name?

I have around 500+ files and I know how to merge them. But the problem is I would like to merge them in such a way that every file starts with the file neme in its first page. For example I have 3 ...
1
vote
2answers
198 views

Merging log files with different timestamp formats

I have two types of log files Standard Syslog format The timestamp looks as below 5:2015 Dec 21 07:35:06:ABC:foo1:1559: common.c:946:Enabling filter 6:2015 Dec 21 07:35:08:ABC:bar1:1461: api.c:...
1
vote
1answer
149 views

Merge two different /home folders together with same user accounts, keeping newest files

This is a little bit tough. In order to reinstall/upgrade a Linux OS, and both keep the /home folder and contents, reformat the target partition, install the new OS, and merge the /home folder and ...
1
vote
2answers
197 views

How can I merge multiple lines with spaces (blank line) separating them? [closed]

I'd like to merge the following multiple lines of output so that they form a single line: line 1: ,,,1,,,,,,,,18,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,42,1,121,1,17,10,21,1,,IU,8,0,,...
1
vote
5answers
183 views

how to merge different files that have the same header but slightly different file name?

I have a problem in merging files for a big data sets like below. I want you help me to let me know the script that can do such task. fine name: fluxes_year_lat_long I have 30 years of daily fluxes ...
1
vote
2answers
183 views

Merge a number of text files into one with next line for every file

I have 2 files. I want to merge them. File1 contents: abc File2 contents: def Combined File should be: abc def
1
vote
2answers
22 views

Merge PDF document but with conditions

I make bus timetable booklets for drivers every day, and I have 4 PDF files: Special Instruction Sheet (Every day different) Bus daily timetable (which is always different) Bus Assistant daily ...
1
vote
1answer
393 views

Merge multiple HTML files in reverse order?

I have multiple HTML files for this book. I am trying to add them in opposite order. I've tried: cat *.html >> merge.html I've tried to use tac on the list of downloaded files by time to no ...
1
vote
1answer
2k views

Shell script to merge properties file (sed/awk/comm/diff) for rpm upgrade

We're developing a java product that's installed via rpm. We have a set of config files that a user can edit. These config files are java properties files in the form: com.acme.pkg1.setting=something ...
1
vote
1answer
33 views

Compare and merge config file in CentOS

I was trying to setup an auto-update (for multiple servers) bash script via cron to a config file (text based) by downloading the new file everyday and replacing it directly. The script works fine, ...
1
vote
1answer
93 views

Compare 2 Columns in 2 different files

I need to subtract second and third columns between 2 files based on the first column and do not show rows with diff_column_2(DIFF-IO)=diff_column_3(DIFF-SELECT)=0. Noting that the order can be random ...
1
vote
1answer
39 views

How do I merge (without copying) two directories? [duplicate]

I have: $ find 1 2 -printf '%i %p\n' 40011805 1 40011450 1/t 40011923 1/a 40014006 1/a/e 40011217 1/a/q 40011806 2 40011458 2/y 40011924 2/a 40013989 2/a/e 40013945 2/a/w I want: <inode> &...
1
vote
1answer
1k views

Merging flv files causes a massive size increase

I have 3 flv files which I wish to merge. I used the answer in this post: Merge multiple flv files? which suggested this option: mencoder -forceidx -ovc copy -oac pcm -o output.flv input1.flv ...
1
vote
1answer
603 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....
1
vote
1answer
83 views

Program to upgrade configuration files

When upgrading Ubuntu (and probably other *nixes), the upgrade process will show a diff of changed configuration files and ask whether I'd like to replace them, keep the old version, or manually merge ...
1
vote
0answers
7 views

Vimdiff copy above/below

do and dp are kinda limited to take one or another version of the conflict, in many cases it's just java imports when you need both changes, is there any way to make a map that copies the other side'...