Created
December 6, 2017 11:01
-
-
Save johanvergeer/1859c191957e4749745454eae902038f to your computer and use it in GitHub Desktop.
Progress OpenEdge Export column names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*------------------------------------------------------------------------ | |
File : Export table headers | |
Purpose : Gist for exporting table headers in Progress OpenEdge | |
Description : | |
Author(s) : Johan Vergeer. With thanks to TheDropper at | |
https://stackoverflow.com/questions/44204335/how-to-add-column-name-while-export-csv-in-progress-4gl#44205839 | |
Created : 6 december 2017 | |
----------------------------------------------------------------------*/ | |
DEF VAR hTable AS HANDLE NO-UNDO. | |
DEF VAR iLoop AS INTEGER NO-UNDO. | |
DEF VAR cDelimiter AS CHAR NO-UNDO INIT ",". | |
hTable = BUFFER Customer:HANDLE. | |
OUTPUT TO customer1.csv. | |
/* Export header row. */ | |
DO iLoop = 1 TO hTable:NUM-FIELDS: | |
PUT UNFORMATTED hTable:BUFFER-FIELD(iLoop):NAME. | |
IF iLoop < hTable:NUM-FIELDS THEN | |
PUT UNFORMATTED cDelimiter. | |
END. | |
PUT SKIP. | |
/* Export records. */ | |
FOR EACH Customer: | |
EXPORT DELIMITER "," Customer. | |
END. | |
OUTPUT CLOSE. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perfect! Thanks