문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top