-1

struggling to figure out how to read certain values from a csv file. Help would be appreciated.

INPUT VALUE FROM cFilePath.
    REPEAT:
    CREATE ttTable
    IMPORT DELIMITER ","
    END.
OUTPUT CLOSE.
Misteris3
  • 9
  • 1
  • Does this answer your question? [How to read data from a .csv file and store it in a table in openedge](https://stackoverflow.com/questions/30120062/how-to-read-data-from-a-csv-file-and-store-it-in-a-table-in-openedge) (It is the first result when doing a search on SO: [openedge read from csv](https://stackoverflow.com/search?q=openedge+read+from+csv)) – Luuk May 06 '23 at 06:39
  • Also, please read: [How to ask](https://stackoverflow.com/help/how-to-ask) – Luuk May 06 '23 at 06:42
  • Your sample code is probably providing some helpful error messages when you try to run it. It is always good to post those as well. – Tom Bascom May 08 '23 at 12:47

1 Answers1

0

The main issue in your sample code is that you are not specifying a place to put the data being read by IMPORT. One possible solution:

INPUT FROM VALUE( cFilePath ).       /* FROM and VALUE were in the wrong order */
REPEAT:
    CREATE ttTable
    IMPORT DELIMITER "," ttTable.    /* read the data into the ttTable record that you just created */
END.
INPUT CLOSE.                         /* this used to say "OUTPUT: :( */
Tom Bascom
  • 13,405
  • 2
  • 27
  • 33