Using IMPORT

Posted by Admin on 10-Aug-2006 14:53

I do a lot of importing of text files, typically tab delimited. My problem is, sometimes one of the columns is a notes column and contains 'carriage return' characters (chr(13) characters). Progress interprets these as the end of the line. I am wondering if there is a way to get around this and only have progress interpret line feeds (chr(10) characters) as the end of a line, leaving the carriage return characters in the variable the line is being read into. I could then replace these characters with something else if needed.

This is the typical code I use to import a file:

DEFINE STREAM IMPORT-STR.

DEF VAR V-FILE-TEXT AS CHAR NO-UNDO.

INPUT STREAM IMPORT-STR FROM VALUE("").

REPEAT ON ENDKEY UNDO, LEAVE:

IMPORT STREAM IMPORT-STR UNFORMATTED V-FILE-TEXT.

/*process V-FILE-TEXT here */

END.

All Replies

Posted by jtownsen on 11-Aug-2006 01:56

Perhaps the Quoter utility might be of use - particularly with the -d or -c options. You'll find more information in the documentation (OpenEdge Development: Programming Interfaces - http://documentation.progress.com/output/OpenEdge101a/wwhelp/wwhimpl/java/html/wwhelp.htm?href=dvpin/dvpin-33-2.html).

Let us know if that doesn't work for you.

This thread is closed