Notepad++

Combine two separate files line by line in Notepad++

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:

  1. Open a new tab ( Ctrl + N )
  2. Select the contents of File 1 and paste them in this new tab
  3. Write any symbols in a new line. Eg: ______ ( Type 3 _ characters )
  4. Select the contents of File 2 and paste them, in the new tab, BELOW the ___ line
  5. Open the Replace dialog ( Ctrl + H )
  6. SEARCH : (?s)^___.+|(?-s)^.*(?=\R(?:.*\R){n}(^.*)) ( Just replace n with the appropriate number of lines )
  7. REPLACE: ?1$0\1
  8. OPTIONS: Wrap Around and Regular expression set. All other options unticked
  9. 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


Gokul Deepak S

View Comments

Published by
Gokul Deepak S

Recent Posts

Running crontab on AWS auto scaling group

Linux has a convenient feature of running cronjob which will get executed at the correct…

11 months ago

Learn with Gokul

As famous Tamil poet Auvaiyar said "Katradhu Kai Mann Alavu, Kallathathu Ulaga Alavu" which is…

11 months ago

Terraform Cheat sheet

Terraform Cheatsheet with pdf. You can download Terraform Cheatsheet pdf with all Terraform CLI commands…

11 months ago

Strategy to prepare for Terraform Associate Exam Preparation

I was planning to do Terraform certification a long time ago. I have worked on…

11 months ago

Runcloud vs SiteGround Comparision

As a user of both of these services has got multiple benefits with both of…

2 years ago

Important Docker Commands to remember

You need not memorize these important docker commands. Repeated usage will make it easy for…

2 years ago

This website uses cookies.