Clear questions and runnable code
get the best and fastest answer
Re^11: How best to strip text from a file?by Kenosis (Priest)
|on Nov 13, 2012 at 02:35 UTC||Need Help??|
Am glad this is shaping up for you, and I think you've done well building on to this...
Here are a few items for you to consider...
Use another hash to keep track of previously-seen Orders. Without re-posting the entire code, here's what you can add to make this functional:
Add a %seen hash:
Add a RECORD: label at the start of the line, in front of the for that iterates through each record (Order):
Finally, use an if() statement to process the Order ID (instead of a single line like with the other fields):
I suspect you can see what this does, but if an Order ID: match is found, it first checks to see if the ID's already been 'seen.' If so, it gets the next record for processing, else it tags the Order as seen and sets the hash.
Write to your Excel file from within your subroutine. 1) You've got a complete record by the time the subroutine is called in the script (see its current position). You can send your subroutine the row number:
Then, in the subroutine:
2) By writing to the Excel spread sheet from within the subroutine, you're somewhat modularizing your program by keeping its functionality separate.
Let me know how your spread sheet writing is going or if you encounter any other issues...