I'm suprised that matched subexpressions are not exposed in Textpipe's automation. I have a simple task but have yet figured out how to do it without creating huge and slow arrays. i.e.
I have a graphic description file with thousands of entries such as:
"filename", "filedesc", <category>, 1-20-2004 T12:01:03
All I wanted to do was parse each line, create a folder with the category name , then create a subfolder with the filedesc as name, and finally move the file inside. It would be a piece of cake if the processline method passed an array of matched subexpressions (if any/applicable).
The only other 'easy' way would be if the entire filter sequence had the option of being executed (except for input and output) for each line of input instead of the entire thing.
Access to matched subexpressions through automation
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:
You can use the 'Restrict to each line in turn' filter to handle the file one line at a time.
Another useful method might be to modify the pattern match so that it replaces the text in an easy-to-parse form for VBScript eg
"filename", "filedesc", <category>, 1-20-2004 T12:01:03
to
category#filedesc#filename
Then you can use VBScript's split function to split this into an array.
That should help!
Another useful method might be to modify the pattern match so that it replaces the text in an easy-to-parse form for VBScript eg
"filename", "filedesc", <category>, 1-20-2004 T12:01:03
to
category#filedesc#filename
Then you can use VBScript's split function to split this into an array.
That should help!