Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merging two lines into one - Notepad++

I have a line like this

assignee: Akebono Brake Industry Co. Ltd.  , 
 Fujitsu Limited  application_no: 06/946,825

I want the output to be

assignee: Akebono Brake Industry Co. Ltd.  , Fujitsu Limited  
application_no: 06/946,825

To bring the application_no: 06/946,825 to the next line, I can find application_no: and replace it with \napplication_no: in my NOTEPAD++

But, how can I bring that string that spans to next line back to the first line? I mean what should I do to get the Fujitsu Limited to the line starting with assignee:

Any guidance please?

like image 584
Bhavani Kannan Avatar asked Dec 04 '25 19:12

Bhavani Kannan


1 Answers

Since Extended is the only mode that handles the newlines correctly but you need to match with regular expressions, you will need to do this in two steps.

First, use a regex find and replace to add some recognizable token to the beginning of each line you want to move up, I used 'MATCH' but you could definitely change this.

Step 1: Add a token to beginning of matching lines

Then, switch to Extended to search for a newline followed by the token, and replace it with an empty string to delete both the line break and the token.

Step 2: Use the token to remove the line break

like image 152
Andrew Clark Avatar answered Dec 06 '25 10:12

Andrew Clark



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!