=============================================================================== ========================== ============================ ========================== EXAMPLE # 2 ============================ ========================== ============================ =============================================================================== THE INPUT FILE: Inventory report, generated by an accounting program WHAT WE WANT: Copy certain fields into a comma-delimited file so that the data can then be imported into a spreadsheet. The file must contain the following fields: Reference number, Price, Quantity, Part Number, Description HOW WE DO IT: We copy data from fixed columns, tidy them up, put quotes around them, then send them to the output file. However, certain lines must be inspected to ensure that they contain valid data. For example, if a line contains "Date:" between columns 1 and 8, it is a header line, not data. Since the input data for each item is spread over more than one line, we must also keep a counter (named ITEMCNTR) to tell us which line we're looking at.