Question

As I know How to import csv file into Progress database, I would like to know the sample script to import xls file into progress database.

please advise me.

Was it helpful?

Solution

There are many different XLS compatible formats. CSV or TAB delimited are two very easy ones to work with. The newer formats are complex, compressed XML archives.

CSV and TAB and the ilk are easy. Just use IMPORT DELIMITER.

Example using a semicolon (;) separated file (normally with extension.csv).

/* Fields in temp-table matches the columns of the .csv-file */
DEFINE TEMP-TABLE ttExample NO-UNDO 
    FIELD col1 AS CHARACTER 
    FIELD col2 AS INTEGER
    FIELD col3 AS DATE.

INPUT FROM c:\temp\test.csv.
REPEAT:
    CREATE ttExample.
    IMPORT DELIMITER ";" ttExample.
END.
INPUT CLOSE.

There are also some older formats like SYLK. There is an import for that hanging somewhere off the data dictionary tools if I recall.

Excel also deals well with HTML tables. A fragment of HTML consisting of tags is easily imported by Excel.

The newer .xlsx formats have no direct Progress 4GL import available and you would need to first research and specify the details of the format you are using. First you will need to uncompress. Then you need to handle the XML inside.

OTHER TIPS

IMPORT DELIMITER "," /* field list here */.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top