Using data fields that don't appear on every input record

Support for DataSlave

Moderators: Tom, ian

Using data fields that don't appear on every input record

Postby ceejayemm » Wed Mar 09, 2011 1:22 pm

I have a text file (essentially a log file) which contains one row for each action taken on a Purchase Order (PO), a simplified data sample would be:

The output flags for PO 2602432 read, <CF_Print_Flags> YNN <--PO 1 starts here
Send Mail: connecting to automail.cc.ic.ac.uk
Sent mail to xxxxxxxxxxx
Emptied Bag - 6536 bytes
The output flags for PO 2602321 read, <CF_Print_Flags> YNN <-- PO 2 starts here
Send Mail: connecting to automail.cc.ic.ac.uk
Sent mail to xxxxxxxxxxx
Emptied Bag - 6536 bytes
The output flags for PO 2602891 read, <CF_Print_Flags> YNN <-- PO 3 starts here
Send Mail: connecting to automail.cc.ic.ac.uk
Sent mail to xxxxxxxxxxx
Emptied Bag - 6536 bytes

I have written a transform process to act on each input line to do some further action / analysis for each PO which eventually writes the results to a new file however I would also like to append the PO Number (PO 2602432 in the case of PO 1 above) which appears in the first row of the data for each PO to each output line for that PO to give something like:

PO 2602432 The output flags for PO 2602432 read, <CF_Print_Flags> YNN
PO 2602432 Send Mail: connecting to automail.cc.ic.ac.uk
PO 2602432 Sent mail to xxxxxxxxxxx
PO 2602432 Emptied Bag - 6536 bytes

How can I achieve this ?

Chris
ceejayemm
 
Posts: 22
Joined: Mon Apr 23, 2007 1:29 pm
Location: London, UK

Re: Using data fields that don't appear on every input recor

Postby ian » Wed Mar 09, 2011 5:11 pm

This needs you to use a Map-level script object. I attach a sample that illustrates how to do this.
Attachments
Report2.zip
(45.6 KiB) Downloaded 438 times
ian
 
Posts: 364
Joined: Sat Dec 18, 2004 8:13 am
Location: UK


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron