1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in
 
Idea sandbox Idea sandbox
Popular ideas Popular ideas
Ideas in development Ideas in development
Implemented ideas Implemented ideas
Idea #659: Search for a string and replace entire line

bug This idea was marked as already implemented the 26 November 13.
Written by hector7007 the 22 Aug 13 at 12:28. Category: Find / Replace dialog. Related project: Nothing/Others. Status: Already implemented
Rationale
Search a large number of config.txt files looking for all the lines that start with a specific string:
UserID=
This may return values such as:
UserID=Jerry
UserID=Bob
UserID=Notepadd++

I would like to replace all of these lines with:
UserID=George
Tags: (none)

-1
votes
closed
Solution #1: Replace entire line when string found
Written by hector7007 the 22 Aug 13 at 12:28.
Search for a sting in all lines in a file
When the string is found (normally at the beginning, but it could be anywhere in the line)
Replace the entire line
-1
votes
closed
Solution #2: Us plain regular expressions
Written by cchris the 25 Aug 13 at 12:14.
Find
(^\s*UserId\s*=).*
set mode to Regular expressions
make sure ". matches newline" is not checked
Replace with
\1 George
Replace All
1
votes
closed
Solution #3: Use the options availiable on npp search menu.
Written by johnnyfs the 5 Sep 13 at 13:19.
Do the following:

Search > Find
Choose the tab called 'Mark'
Type on the searchbox the string you want to find and check the 'bookmark line' checkbox.

All the lines with the selected string are now marked.

Copy the string you want to replace, in this case UserID=George.

Now go to Search > Bookmark > Paste to (Replace) bookmarked lines.

I hope this helps.
Regards.

Propose your solution


Duplicates


Comments
No comments.

Post your comment
Syndicate content