Okay so, I want to merge 2 text files :
File 1 :
Firstline
ABCD
Thirdline
Fifthine
File 2 :
Firstline
Thirdline
EFGH
Fifthline
Expected output :
Firstline
ABCD
Thirdline
EFGH
Fifthline
I can't use copy filea+fileb filec
with cmd because it just copy and paste one to another and merge it into one file.
Try the following procedure with notepad++:
Go to file1 and add some data that cannot be found on the lines (for example @@@@@
) at the beggining of each line with following regex replace: search (regex): ^
Replace by: @@@@@
. After that, first file should look like this:
@@@@@Firstline
@@@@@ABCD
@@@@@Thirdline
@@@@@
@@@@@Fifthine
Go to second file and select (as columns) all data. You can do this placing at the beggining of the file and the ALT+SHIFT+(END, PAGEUP)
- Control+C for copy
Go to first file, place at the beggining and paste with Control+V. The first file now should look like this:
Firstline@@@@@Firstline
@@@@@ABCD
Thirdline@@@@@Thirdline
EFGH@@@@@
Fifthline@@@@@Fifthine
Do a search and replace: Search (regex): ^@@@@@|@@@@@[^\n\r]*
Replace: (nothing)
. The first file will be:
Firstline
ABCD
Thirdline
EFGH
Fifthline