I might be seeing this wrong, but it looks like using regular strings would work. PlantA=''hdr" // sinxe you said the header never changes, they all start with it, right? Plantb=''hdr' Plantc='hdr' Plantd='hdr'
then loop through each line of the input file, figure out which plant it belongs to and append it to that plant's string. Al >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 Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

