Problem:
I need to combine two separate files line by line.
For Eg:
Consider I have two text files file 1 and file 2.
File 1 contains the following text
Start of Line 1
Start of Line 2
Start of Line 3
.
.
.
Start of Line N
File 2 Contains the following text
End of Line 1
End of Line 2
End of Line 3
.
.
.
End of Line N
Solution:
- Open a new tab ( Ctrl + N )
- Select the contents of File 1 and paste them in this new tab
- Write any symbols in a new line. Eg: ______ ( Type 3 _ characters )
- Select the contents of File 2 and paste them, in the new tab, BELOW the ___ line
- Open the Replace dialog ( Ctrl + H )
- SEARCH : (?s)^___.+|(?-s)^.*(?=\R(?:.*\R){n}(^.*)) ( Just replace n with the appropriate number of lines )
- REPLACE: ?1$0\1
- OPTIONS: Wrap Around and Regular expression set. All other options unticked
- ACTION: Click on the Replace All button
Result:
File 3
Start of Line 1End of Line 1
Start of Line 2End of Line 2
Start of Line 3End of Line 3
..
..
..
Start of Line NEnd of Line N