VB6 - Read text file of orders and write to separate text files
Posted on 2007-07-31
I have a text file with multiple orders that I need to separate out into individual text files based on order number.
The text file consists of 3 segments:
1. Header rows for all the orders
2. Detail lines for all the orders
3. Summary lines for all the orders
The number of detail lines will vary per order. The number of orders will vary per text file.
Here is the structure of what the input order file would look like.
I need to parse out each order based on order number which will be in position 4 thru 10.
Base on the example above, the text file for order1 would look like this:
Im not sure of the best way to approach the logic. Any help there would be a good start. And/or sample code would be awesome.