In Textpad or Notepad++ is there an option to export all the matches for a regular expression find, as a single list?
In a big text file, I am searching for tags (words enclosed in % %), using regular expression %\< and \>%
, and want all the matches as a single list, so that I can remove duplicates using Excel and get a list of unique tags.
Answer
You can achieve this by using Backreferences and Find and Mark functionality in Notepad++.
Find the matches using regex (say
%(.*?)%
) and replace it by\n%\1%\n
, after this we will have our target word in separate lines (i.e. no line will have more than one matched word)Use the Search-->Find-->Mark functionality to mark each line with regex
%(.*?)%
and remember to tick 'Bookmark Line' before marking the text- Select Search-->Bookmark-->Remove Unmarked Lines
- Save the remaining text. It is the required list.
No comments:
Post a Comment