Hi,

I need to parse an EDI file, determine it's routing(s),
then rebuild the file(s) and save to a folder on my server.

I'm having a bit of a problem with this...
I am able to parse the file ( pipe delimited ) but am having a bit
of a brain cramp trying to figure out how to put it back together!

The pipe delimited EDI file looks something like this:

hdr|N|||CUST_ID|CUST_ID|14|3093|20030702|20030604|173645| 
|00|SA||PO_NUM|20030604||1826.72 
det||CUST_ID||CUST_ID|14|3093|1|10|||PO_NUM|Item_ID_A|EA|||||748||92|||||EA||42.5|||T 
det||CUST_ID||CUST_ID|14|3093|2|10|||PO_NUM|Item_ID_B|EA|||||748||92|||||EA||38.66|||T 
det||CUST_ID||CUST_ID|14|3093|3|05|||PO_NUM|Item_ID_C|EA|||||748||92|||||EA||31.8|||T 
det||CUST_ID||CUST_ID|14|3093|4|24|||PO_NUM|Item_ID_E|EA|||||748||92|||||EA||11.78|||T 
det||CUST_ID||CUST_ID|14|3093|5|12|||PO_NUM|Item_ID_D|EA|||||748||92|||||EA||16.64|||T 
det||CUST_ID||CUST_ID|14|3093|6|21|||PO_NUM|Item_ID_F|EA|||||748||92|||||EA||27.32|||T 
rel|D||CUST_ID|CUST_ID|14|3093|1|20030702|||PO_NUM|20030702||20030702|1|10 
rel|D||CUST_ID|CUST_ID|14|3093|2|20030702|||PO_NUM|20030702||20030702|2|10 
rel|D||CUST_ID|CUST_ID|14|3093|3|20030702|||PO_NUM|20030702||20030702|3|5 
rel|D||CUST_ID|CUST_ID|14|3093|4|20030702|||PO_NUM|20030702||20030702|4|24 
rel|D||CUST_ID|CUST_ID|14|3093|5|20030702|||PO_NUM|20030702||20030702|5|12 
rel|D||CUST_ID|CUST_ID|14|3093|6|20030702|||PO_NUM|20030702||20030702|6|21



We have five manufacturing plants, So I have to do a 'look-up' based on the Item_ID 
located on
the 'det' line, then 'Rebuild' the file to only include those items for that plant. 
The 'hdr' will always stay the same.
the 'rel' line has to match to the 'det' line. So......

I need to parse the file, lookup the Item_ID from the 'det' line, then rebuild the 
file ( with the matching 'rel' line )
The file could then look like:

Plant_A ( based on lookup )

hdr||
det||
rel||

Plant_B ( based on lookup )

hdr||
det||
det||
rel||
rel||

Plant_C ( based on lookup )

hdr||
det||
det||
det||
rel||
rel||
rel||

Sounds complicated to me.. maybe storing in arrays ??

Thanks if possible,
Dave

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to