Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    The Netherlands

    Unanswered: Linefeeds & Carriage returns


    In text files created by Unix a line ends (and in those cases the record) with a linefeed (chr(10))
    If you then want to import the file into access it sees it as 1 long line.
    Now i have found that to be a major pain, and one can work around by reading the file character by character. This however causes the import to take a very long time.

    Also i have noticed that in a certain environment, using A2k sp-3 on a win 2k machine access will accept the chr(10) as the "carriage return" thus importing the file properly. On other systems tho, NT/A97 and XP/AXP, it sees it as one line.

    Does anyone have any info on the how when and why of this? I tried googling, MSDN and searching on the forum, but could not find anything trully relevant. Except maybe that Access should see it as 1 line, except for the earliest version (2).



  2. #2
    Join Date
    Dec 2004
    I didn't have only one line, but for each Carriage Return an unprintable sign in my Textfields.
    I tried it that way with an ExcelImport (hope it helps):

    I import the data in a temporary table which is to be deleted after the import is done. Then open a recordset with all the data of the temp table. And then for each record of the set:

    dim tmp as string
    dim yourString as string
    tmp = recordsetname!fieldname
    yourString = Replace(tmp, Chr(10), Chr(13) & Chr(10), 1, -1)

    This replaces each CarriageReturn with a CarriageReturn AND LineFeed. It seems to be important that the Linefeed comes first.

    If this is something that doesn't help: sorry.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts