Access to matched subexpressions through automation

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
Calvin
Posts: 1
Joined: Tue Mar 02, 2004 1:31 am

Access to matched subexpressions through automation

Post 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.
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post 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
to
category#filedesc#filename

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

:lol: That should help!
Post Reply