Multiple item - single search

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
zchemical
Posts: 2
Joined: Thu Jun 02, 2005 7:56 pm

Multiple item - single search

Post by zchemical »

hi,

I've been a user of Textpad for some time. One thing I've never quite had a chance to figure out is the ability (if it exists) to run multiple search items at once. For example, how would I take a text file with line by line entries and have Textpad run all those entries against a file opened in textpad. I use Textpad to parse log data, and would be extremely beneficial for me to be able to do so. Anyone know how to do this?


Thanks in advance.
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

I suspect that nobody replied last time because it's not particularly simple. Here's a slightly non-simple way to do it:

In the file containing the search strings, run the following search and replace:
Find what: \n
Replace with: |

[X] Regular expression
Remove the trailing | (if there is one) from the result.
Copy the lot, switch to the other file, open the "Find" dialogue box, paste the search expression into it, and run a search, again with "Regular expression" selected.

You'll need to adjust the search expression if any of the search strings contain special regular expression characters.

This assumes you are using POSIX regular expression syntax:
Configuration | Preferences | Editor

[X] Use POSIX regular expression syntax
Believe it or not, I do this sort of thing quite often...
David Haslam
Posts: 24
Joined: Wed Oct 01, 2003 2:24 pm
Location: United Kingdom
Contact:

Parsing log file data

Post by David Haslam »

Off-topic as regards Textpad, but you might wish to consider DataMystic TextPipe for parsing log files.I found TextPipe Standard was a ready made solution to process CSV files that had more than 256 fields, so that I could open them using Excel.
Best regards,

David F Haslam, MA, CEng, MIEE
Post Reply