Page 1 of 1

Did I miss something?

Posted: Tue Nov 04, 2003 8:53 am
by Christian Lempereur
Textpipe is OK but I wonder if I can do the following :

I have a file consisting of a header and a number of detail lines. I have to find some values in the header part and put them on each detail line to make a CSV for another application.
I've been searching for the whole WE and could not find a solution.
The input file looks like this (dummy example) :

*** Header ***
PartNo : 123456
date : 20031021
order : ...
*** end of header ***
862836 18/10/03
778235 18/10/03
889765 19/10/03

the output should be :
123456,862836,21/10/2003,18/10/2003
123456,778235,21/10/2003,18/10/2003
123456,889765,21/10/2003,19/10/2003

Any suggestion?

christian

Posted: Thu Nov 06, 2003 6:55 am
by DataMystic Support
Hi Christian,

Yes, this can certainly be done.

Use a pattern match to capture the header fields, and use a VBScript sub filter to save them to global variables.

Then when you process the detail lines, use another VBScript filter to output the values of the global variables on each line.

Posted: Thu Nov 06, 2003 6:23 pm
by Christian Lempereur
VBScript, meaning only with TextPipe PRO, I need to upgrade then.
Not a problem, I am so satisfied with the standard, I'm sure Pro will provide me even more fun!

christian

Posted: Fri Nov 07, 2003 11:29 am
by DataMystic Support
Thank you!

Have you checked out the latest 6.6.3 version?

Finally got Global variables to work

Posted: Sun Jul 18, 2004 6:58 am
by Christian Lempereur
I had no time to look into it before now, but I finally upgraded to Textpipe Pro, had to learn how to use VBScript and lost most time finding out how to pass data to a Global variable and getting it back on the line level.
By the way, it is documented and a search in the help with 'global variables' did help me.
I did spend the afternoon playing with MsgBox to understand how VBScript worked with and without subfilters and finally learn a lot on how Textpipe handles the different levels.
Anyway it opens new possibilities and hopefully VBScript does not penalize to much on performance.

By the way thank you for having implemented the date and time macros I asked for a while ago, it did really help, only problem is that it does not get inserted automatically with the right click and I have to type it in. More importantly, it works!

best regards,

christian

Posted: Sun Jul 18, 2004 7:37 am
by DataMystic Support
Thanks Christian,

We have a customer who processes an 800MB file in 2 minutes using a VBScript - so it can't be that slow!

Simon