>Trying to import a colon delimited text file to dbf via append from command. Problem is that in one of the fields (character type) the user is allowed to key in the Enter key hence resulting in the following text data on that particular record to drop down to another line. Even though the complete text is wrapped in the colon, the imported data is completely off from this field onwards.
>Could not use strtran to remove this character as each line contain an end of line character as well.
You can preprocess the file and remove/replace new line characters from inside the field. Here's a sample code that shows how it can be done. You'll have to add error handling and adjust it to your requirements.
lcFileName = "..."
lcFileNameOut = "..."
lnColonsPerLine = 3
lhIn = FOPEN(lcFileName)
lhOut = FCREATE(lcFileNameOut)
DO WHILE NOT FEOF(lhIn)
lcStr = FGETS(lhIn, 512)
DO WHILE OCCURS(":", lcStr) < lnColonsPerLine
lcStr = lcStr + SPACE(1) + FGETS(lhIn, 512)
ENDDO
IF NOT EMPTY(lcStr)
FPUTS(lhOut, lcStr)
ENDIF
ENDDO
FCLOSE(lhIn)
FCLOSE(lhOut)
--sb--