Hi,
I have a list of thousands of rows with a specified ID. I have a second list (txt-file) with 40 ID's, but no information with them: I'd like to use this second file as a tool to extract only the rows in the first file which contain one of those 40 ID. Is this possible?
I'd prefer not to search for every row with the specified ID, as my file is very big.
Thanks in advance,
selecting multiple rows from a list with another textfile
Moderators: AmigoJack, bbadmin, helios, MudGuard
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
Use "Posix" regular expression syntax:
Copy your second file into a temporary editor document.
In the temporary document:
Search | Replace... (<F8>):
ID1|ID2|...|IDn
Copy that line onto the clipboard,
In your first file:
Search | Find... (<F5>):
Edit | Copy Other | Bookmarked Lines
Open a new document and paste the bookmarked lines there.
You can't automate this in TextPad.
Assuming each ID in your second file is on a line of its own, with no other text:Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
Copy your second file into a temporary editor document.
In the temporary document:
Search | Replace... (<F8>):
The temporary document should now contain a single line of this form:Find what: \n
Replace with: |
[X] Regular expression
Replace All
ID1|ID2|...|IDn
Copy that line onto the clipboard,
In your first file:
Search | Find... (<F5>):
Copy the bookmarked lines into the paste buffer:Find what: <-- paste the contents of the clipboard here
[X] Regular expression
Mark All
Edit | Copy Other | Bookmarked Lines
Open a new document and paste the bookmarked lines there.
You can't automate this in TextPad.