RegEx array file

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

RegEx array file

Post by Bob Hansen » Thu Feb 11, 2010 4:39 am

Woudl like to see another switch added to RegEx that would create a text file of the array values. Would like the option of the BEFORE file and the AFTER file, or Both files when a replacement happens.

Example:
RegEx>pattern,text,easypatterns,matches_array,num_matches,replace_flag[,replace_string,replace_result, ArrayFile]

The optional ArrayFile parameter would have a value of Found,Modified,Both.

If ArrayFile = Found it would be a list of match_1...Match_num_matches, each value on a line with the num_match value as a prefix.

If ArrayFile = Modified it would be a list of the modified replacement match_1...Match_n, each value on a line with the n as a prefix.

If ArrayFile = Both then both files would be created. Default location would be %Script_DIR%, but ability for user definition. Names = RegEXBefore.txt and RegExAfter.txt

Here is a sample of a Found file of matches from a web site page:
1 - Court System:
2 - Case Number:
3 - Tracking No:
4 - Case Type:
5 - District Code:

Here is a sample of the same array after a replacement string to extract and capitalize the results:
1 - COURT SYSTEM
2 - CASE NUMBER
3 - TRACKING NO,
4 - CASE TYPE
5 - DISTRICT CODE

I know it is possible to write a loop to cycle and create the files. I have done that many times today. It would be very convenient to have the option to have the files created automatically when the RegEx is run.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts