I need to do a particular search on several hundred files, and output the file name and search results into a separate file or window. The files are all in one folder, and range in size from 45 KB (under 1000 lines of text) to over 19 MB (almost 400,000 lines).
Here's the tricky part: I need to search for a particular string, then find the first occurrence of a different string after that (about 100 lines later, but can't guarantee that number), and output that second line.
Any thoughts on how to accomplish that? I'm not averse to using JavaScript, Perl, regular expressions, etc., but am not an expert in any of that.
I've attached a sample of the text I'm searching for.
For every file, I need to find the line that contains "Name CG$AN" (line 13 in the sample text), but output the first line it after that has "Hint" (line 104).
Thanks,
Dan
Here's the tricky part: I need to search for a particular string, then find the first occurrence of a different string after that (about 100 lines later, but can't guarantee that number), and output that second line.
Any thoughts on how to accomplish that? I'm not averse to using JavaScript, Perl, regular expressions, etc., but am not an expert in any of that.
I've attached a sample of the text I'm searching for.
For every file, I need to find the line that contains "Name CG$AN" (line 13 in the sample text), but output the first line it after that has "Hint" (line 104).
Thanks,
Dan
- Search Example.txt (5.08 KiB) 0