• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Gokul Deepak

Gokul Deepak

GoCool and Debug

  • Home
  • WordPress
  • Android
  • How to
  • About Me

Combine two separate files line by line in Notepad++

August 23, 2020 by Gokul Deepak S 2 Comments

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


Filed Under: Notepad++

Authored by Gokul Deepak S

Leave a Reply Cancel reply

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
John Bradford
John Bradford
8 months ago

You are a genius! Thank you for posting this.

0
Reply
Gokul Deepak S
Gokul Deepak S
Author
Reply to  John Bradford
7 months ago

Thanks a lot John!

0
Reply

Primary Sidebar

Popular Pages

  • How to find the date of the Facebook group it was created
  • Home
  • Elementor Plugin and Nginx Configuration
  • CORS error in Apache Tomcat - Solved
  • How to block access to the wp-content uploads folder
  • How to remove Linux OS in Tamilnadu Government Free Laptop
  • Output for timedatectl list-timezones
  • AWS Instance Types
  • Important Docker Commands to remember
  • Runcloud vs SiteGround Comparision

Archives

Categories

  • Android
  • Apache
  • AWS
  • Blogger
  • Computer Tips
  • DevOps
  • Docker
  • Earn
  • Facebook Tips
  • Git
  • Google Tips
  • Hosting
  • How to
  • Laptop Tips
  • Laptops
  • Linux
  • Mobile
  • MongoDB
  • Nginx
  • Node JS
  • Notepad++
  • PostgresQL
  • Ubuntu
  • Wordpress
  • Xenforo

Tags

Android Android One AWS Bluehost Comparisions Custom ROM Elementor Facebook Genesis Genesis Sample Theme Google Drive How to Lineage OS Notes OnePlus One OwnCloud Rooting Smartphones Stock ROM Studiopress Tomcat Wordpress plugin

Copyright © 2023 ยท Maintained by GokulDeepak

wpDiscuz