Page 1 of 1

Access to matched subexpressions through automation

Posted: Tue Mar 02, 2004 7:02 am
by Calvin
:shock: 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). :D
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.

Posted: Fri Mar 05, 2004 7:54 am
by DataMystic Support
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

Then you can use VBScript's split function to split this into an array.

:lol: That should help!