Find and replace across multiple rows
-
All, I’m extremely new to Notepad++. I’m working on a project for work and am faced with the following issue:
Is there a way for me to combine the first two lines of each item?
I want to convert:
<RECORD>
<RECORD-id>1</RECORD-id>To:
<RECORD id=“1”>And have that apply to all my records in the file. Thanks so much in advance.

-
@Ricardo-Gonzalez said in Find and replace across multiple rows:
I want to convert:
<RECORD>
<RECORD-id>1</RECORD-id>To:
<RECORD id=“1”>That’s a fairly simple job for regular expression search, so long as the format and order stays just as you’ve indicated.
From the main menu, select Search | Replace… and fill in:
Find what:
^\s*<RECORD>\s*\R\s*<RECORD-id>(\d+)</RECORD-id>\s*$Replace with:
<RECORD id="$1">Be sure the radio button Regular expression is selected and use the Replace All button.
-
That worked like a charm. Saved me hours worth of work. Thanks so much, I REALLY appreciate it.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login