问题
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.
回答1:
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 @@@@@ @@@@@FifthineGo 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@@@@@FifthineDo a search and replace: Search (regex):
^@@@@@|@@@@@[^\n\r]*Replace:(nothing). The first file will be:Firstline ABCD Thirdline EFGH Fifthline
来源:https://stackoverflow.com/questions/52757447/how-do-i-merge-2-text-files-into-one-file