DEFINE VARIABLE cReadFromFile AS CHARACTER NO-UNDO EXTENT 100.
/*100 = number of fields that are part of the record (1 line = 1 record in the file)*/
/*you can change this if you like*/
DEFINE VARIABLE cFileName AS CHARACTER NO-UNDO.
DEF STREAM sIn.
ASSIGN
cFileName = SESSION:TEMP-DIRECTORY + "testfile.dat".
INPUT STREAM sIn FROM VALUE(cFileName).
REPEAT:
ASSIGN
cReadFromFile = "":u.
IMPORT STREAM sIn DELIMITER "|":u cReadFromFile.
MESSAGE cReadFromFile[1] SKIP
cReadFromFile[2] SKIP
cReadFromFile[3] SKIP
cReadFromFile[4]
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
INPUT STREAM sIn CLOSE.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.