home *** CD-ROM | disk | FTP | other *** search
/ Netware Super Library / Netware Super Library.iso / file_mgt / parse_m / exampl02.stx < prev    next >
Encoding:
Text File  |  1995-05-02  |  1.7 KB  |  25 lines

  1. ;C
  2. ┌─────────────────────────────────────────────────────────────────────────────┐
  3. │ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░    EXAMPLE # 2    ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ │
  4. └─────────────────────────────────────────────────────────────────────────────┘
  5. ┌─────────────────────────────────────────────────────────────────────────────┐
  6. │                                                                             │
  7. │ THE INPUT FILE:  Inventory report, generated by an accounting program       │
  8. │                                                                             │
  9. │ WHAT WE WANT:    Copy certain fields into a comma-delimited file so that    │
  10. │                  the data can then be imported into a spreadsheet.  The     │
  11. │ file must contain the following fields: Reference Number, Price, Quantity,  │
  12. │ Part Number, and Description.                                               │
  13. │                                                                             │
  14. │ HOW WE DO IT:    We copy data from fixed columns, tidy them up, put quotes  │
  15. │                  around them, then send them to the output file.  However,  │
  16. │ certain lines must be checked to see if they contain valid data.  For       │
  17. │ example, lines containing "Date:" between columns 1 and 8 are header lines, │
  18. │ not data.  Also, since the input data for each item is spread over more     │
  19. │ than one line, we must also keep a counter (named ITEMCNTR) to tell us      │
  20. │ which line we're looking at.                                                │
  21. │                                                                             │
  22. └─────────────────────────────────────────────────────────────────────────────┘
  23.  
  24. ;P
  25.