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.

Filter by
Sorted by
Tagged with
2
votes
1answer
1k views

How to copy/merge two directories and if two files have the same name rename the older one appending its modification time

I have several directories with files which mostly have the same name but might be different and I need to have all these directories merged into a new one. I need to be able to compare the same named ...
1
vote
1answer
139 views

How to join 2 files based on common rows of first columns?

file1 : HOUSAM1189870 3 0.00 0 -2450.00 11 HOUSAM1213135 3 0.00 0 -2620.00 2 HOCANM245675 3 0.00 0 0.00 0 HOUSAM1239242 3 ...
3
votes
1answer
534 views

Join two textfiles on 1st column keeping order and unpairable lines from 1st file

I need to merge two files that I have but I first need it to match before merging them. This is my first file containing lets say 1 Million lines. abcde fghi jklmn opqrs 123456 0000 Second file ...
2
votes
1answer
80 views

Merge multiple files at the differences

I'm running a scripts on a text file, and I want to merge its contents. Let's say that the file is called "file1". file1: This is some text, wow! Now I have few versions after running scripts. ...
2
votes
1answer
80 views

Merging part of kernel - best way?

For example: I have a kernel 3.16 from my embedded support, but I want to have some network wireless drivers from 3.19. What is the best way to merge only this drivers (not full kernel)? I tried ...
2
votes
1answer
1k views

Ssh into multiple servers and merge files into one

I was able to do it with one server with the following code: ssh server001 << EOF cat /dir/file001.txt >> somefile EOF With multiple servers, my script is able to ssh into the servers ...
1
vote
1answer
61 views

Combining files in a directory by header and omitting shared content

so I have found a question on here that is the opposite of what I would like to do here: Concatenate multiple files with same header. I am trying to merge or concatenate 2 files,within a directory ...
2
votes
2answers
90 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 ...
12
votes
3answers
665 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 ...
1
vote
2answers
84 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 report ...
1
vote
1answer
132 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 ...
2
votes
0answers
90 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'...
0
votes
2answers
104 views

copy lines of text between two files using string matches

Looking for some help, I have two files, one is a large list of various names the other is coordinates. both files start each line with an 8 digit code. I want to lookup 8 digit line code from File1 ...
7
votes
3answers
2k 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 ...
4
votes
4answers
167 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 ...
0
votes
1answer
518 views

How to merge or join more than 2 files? [duplicate]

I have four files; file1: gene_id FPKM TRINITY_DN56960_c4_g1 36.91 TRINITY_DN42427_c0_g1 12.83 TRINITY_DN48728_c0_g1 6.22 TRINITY_DN50706_c0_g2 6604.75 TRINITY_DN51449_c1_g1 8.19 ...
24
votes
2answers
3k 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. (...
-1
votes
1answer
3k views

Using sed to merge two lines [duplicate]

I'm trying to merge these two lines that appear periodically in a text file. travel_ by_night_and_day I have tried: sed '/_\nby/_by/s' input.txt > output.txt but, it doesn't do anything. Do I ...
1
vote
1answer
173 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
2answers
4k 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
2answers
80 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
0answers
60 views

How to Do Quality Assurance of Merged Videos?

Code developed originally in the thread How to order and merge many .ts files? which works in statically generated parts of videos to some extend but has limitations in the dynamic view echo '...
1
vote
2answers
924 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:...
7
votes
3answers
261 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 file2 ...
2
votes
2answers
876 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 ...
1
vote
1answer
179 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 ...
0
votes
1answer
22 views

Merge records depending on first three common columns and place the values which are uncommon in the last column as comma separated [duplicate]

Merge records depending on first three common columns and place the values which are uncommon in the last column as comma separated . I have a requirement to do the following- InputFile : HWF ...
1
vote
1answer
82 views

Merge records depending on common columns and specify the values which are uncommon in the last column as comma separated

I need to merge records depending on first three common columns and place the values which are uncommon in the last column as comma separated . I have a requirement to do the following- InputFile : ...
4
votes
4answers
195 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 ...
1
vote
1answer
46 views

Scan though directory of files and find replicates with same name and concatenate them into one file

I have a directory with a bunch of files For example: ExperimentA_Rep1.bed ExperimentA_Rep2.bed ExperimentA_Rep3.bed ExperimentB_Rep1.bed ExperimentD_Rep1.bed ExperimentC_Rep1.bed ...
0
votes
1answer
122 views

Merging and appending tables to create a master table of multiple tables

How to we can merge and append the multiple tables in the same format having same as well as different data point and merge all of the together by inputting zero to the null data points. Desired input ...
0
votes
2answers
97 views

Merge Two files depending on a Column, nth occurrence of a string in the column of file 1 to be merged with nth occurrence

Merge Two files depending on a column, nth occurrence of a string in column1 of file1 should be merged with nth occurrence of the same string in column1 of file2. I tried join but the results are not ...
0
votes
1answer
111 views

Compare first column of 2 files based on the second column using the delimiter ;

I need to compare below 2 files. The head_file: 2345;int builder( 1000;char type::edit::display <test>( 250;void unamed_string_tree* The ref_file: 2000;int builder( 500;...
1
vote
1answer
996 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 ...
4
votes
2answers
1k 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 ...
1
vote
3answers
556 views

Using awk to merge 2 files

I would like to merge 2 files based on column 1, 2, 3. I have tried the awk command below but is not working. awk 'NR==FNR {h[$1FS$2FS$3]=$4; next}{k=$1FS$2FS$3; if (k in h) print $1,$2,$3,$4,h[k] ;...
1
vote
1answer
2k 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 ...
-2
votes
1answer
941 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 ...
2
votes
0answers
126 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
1k 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.
3
votes
1answer
818 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 ...
0
votes
1answer
2k views

Why is .gitattributes applied only to files added to repo after defining it?

In my repos I'm implementing a new interesting strategy to preserve some versioned files from merges, that makes use of custom merge drivers and .gitattributes. Please take a look: http://git-scm.com/...
21
votes
2answers
79k 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 ...
1
vote
1answer
94 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> <...
3
votes
1answer
365 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 @...
0
votes
3answers
24k views

How to merge partition with gparted?

How I can merge all of my three unallocated spaces? And i want the bigger one to be under /dev/sda5. Gparted screenshot:
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 ...
8
votes
2answers
16k views

join multiple lines based on column1

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 ...
0
votes
1answer
808 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 ...
5
votes
4answers
6k 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: ...