I want to search a 200+ GB file for specific targets (i.e., "jsmith@zmail.com").
When a target is found, I want to extract X characters before the target and Y characters after.
Thus the results might look something like ("abcd" . . . [80 characters] . . . jsmith@zmail.com . . . [750 characters] . . . "wxyz").
Is this possible in TextPipe v9.9.
Jerry
Find subject, extract X characters before and Y characters after
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Find subject, extract X characters before and Y characters after
Hi Jerry,
Yes, absolutely. The simplest way to do this is with an EasyPattern search/replace:
Replace with:
And turn extract matches on - this discards non-matching text.
This outputs each match on a line of its own.
Do you need to know the line number? If so, an Extract Matches filter can be better, as it includes the line number and can also include lines of context before and after.
Yes, absolutely. The simplest way to do this is with an EasyPattern search/replace:
Code: Select all
[40 characters]jsmith@zmail.com[40 characters]
Code: Select all
$0\r\n
This outputs each match on a line of its own.
Do you need to know the line number? If so, an Extract Matches filter can be better, as it includes the line number and can also include lines of context before and after.