Progress
Programming
Handbook
Converting Non-standard Input Files
The input files used in the previous examples contained data that was in a very specific format:
When using a data file as an input source, Progress, by default, expects that file to conform to the following standards:
What if you need to deal with an input file that does not conform to these standards? For example, you might have a file in which each field is on a separate line; or where fields are separated by commas instead of spaces; or where the fields have no special delimiters, but appear at specific column locations.
Progress provides two strategies for dealing with such files:
Which method you choose depends on your particular circumstances. For example:
- The frame-based statements, such as SET, validate the format of the incoming data; IMPORT does not. In some cases you want this validation and in others you might not want it.
- If you expect to read the same file repeatedly, preprocessing that file once with QUOTER might be worthwhile. However, if your code reads from different files, or the content of the file is subject to change, you might want to avoid repeated preprocessing by using IMPORT instead.
The following section explains how to use QUOTER. For more information on using the IMPORT statement, see the "Importing and Exporting Data" section.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |