See if notepad++ meets some of my needs
-
Hey guys!
I would like to propose some situations and see if notepad++ meets them:- Show all lines that contain an asterisk in column 7;
- Show all lines that contain the word MOVE between columns 23 and 42;
- Replace the word MOVE with the word SET only between columns 27 and 93;
- Show all lines that contain the word MOVE or the word WRITE;
- Show all lines that contain the word MOVE and the word WRITE;
Cheers
Arí Ricardo
São Paulo - Brazil -
@nightrider43 said in See if notepad++ meets some of my needs:
Hey guys!
I would like to propose some situations and see if notepad++ meets them:- Show all lines that contain an asterisk in column 7;
- Show all lines that contain the word MOVE between columns 23 and 42;
- Replace the word MOVE with the word SET only between columns 27 and 93;
- Show all lines that contain the word MOVE or the word WRITE;
- Show all lines that contain the word MOVE and the word WRITE;
Assuming you mean “find all lines”, not “show the matching lines and hide any others”, then yes, all of those are quite doable using Notepad++'s search dialog in Search Mode = Regular Expression mode.
- FIND =
^......\*
- FIND =
^.{22,38}MOVE
- FIND =
^.{26,90}\KMOVE
REPLACE =SET
- FIND =
^.*(MOVE|WRITE)
- FIND =
^(?=.*aaa)(?=.*bbb).*$
(The last was derived from Logic Gates for Regular Expressions)
All of those regex assume you have chosen Search Mode = Regular Expression and assume you have not checkmarked the . matches newline option
Some of the column counts (the numbers in {curly braces}) may be off by a few from your definition, depending on whether “
MOVE
between columns 23 and 42” means “M
could be as early as 23 or as late as 42 ⇒.{22,41}
” or “M
could be as early as 23 or the final letterE
as late as 42 so theM
can only be as late as 39 ⇒.{22,38}
” or “‘between’ is non-inclusive, soM
must be after 23 andE
must be before 42 ⇒.{23,37}
” … similarly on the other numerical entries.Except on item 3, if you want them to select the whole line instead of just the first portion until the match, add
.*$
to the end of the regular expression----
Useful References
-
Hi all
About Showing all lines that contain something you’re looking for, you can also use use Find dialog by clicking on “Find All in Current Document” button: N++ will open a Search results pane where it lists all the lines that contain hits.
This also works on multiple files: clicking on Find All in All Opened Documents button.
Also in Find in files tab page of the Find dialog is possible to search in directory trees performing a bunch of action on the files they contain.
And in Find in Projects tab page is possible to search in N++ Projects also ( you can define a project by using Menu View > Project Panels > … sub menu)
Another thing you can also with the help of the Find dialog is going to the *Mark tab page and check *Bookmark line, than click on Mark All: a bookmark (a blue circle/sphere like icon ) is added at the left side of the the lines containing matches and the matches themselves are highlighted with a background color. At this point you can go to menu Search > Bookmark > Copy [or Cut or Remove] Bookmarked lines (or the others). If you perform a copy or cut action on them from such sub menu, you can paste them into another file, for instance to have them all in one place and edit as you need them all, with ease. -
@wonkawilly said in See if notepad++ meets some of my needs:
Also in Find in files tab page of the Find dialog is possible to search in directory trees performing a bunch of action on the files they contain.
If by “bunch of action” you mean “find” or “replace” (not sure that is a “bunch”), then you are correct.
-
@Alan-Kilborn said in See if notepad++ meets some of my needs:
@wonkawilly said in See if notepad++ meets some of my needs:
Also in Find in files tab page of the Find dialog is possible to search in directory trees performing a bunch of action on the files they contain.
If by “bunch of action” you mean “find” or “replace” (not sure that is a “bunch”), then you are correct.
I accurately Define “bunch” in Find in Files:
1 Normal Find [& Replace]
2 Extended Find [& Replace]
3 RegEx Find [& Replace]
4 Filter the files the user wants to Find [& Replace] in
5 Follow current doc to Find [& Replace] in its dir (I suppose, but I’ve never used this option)
6 Chose a dir to Find [& Replace] in and relative sub dirs and also hidden dirs
7 Discriminate (or not) uppercase / lowercase letters for both Find [& Replace]
8 Discriminate (or not) whole words for Find [& Replace]Since the above actions could be performed as “Find” or “Find & Replace” they are a total of 16 possibilities: IMHO this could be identified as a “bunch” of actions, but of course I am open to learn more about English language semantic nuances / shades and I will be happy to post an errata corrige about my previous post to correct possible errors, if any.
-
This isn’t really 16 “actions”.
This is 16 (or how many every) options on a couple of basic actions.
I don’t know…probably not worth discussing further… -
@Alan-Kilborn said in See if notepad++ meets some of my needs:
@wonkawilly
probably not worth discussing further…I also agree