Importing text with linebreaks into memo fields

  • Thread starter Thread starter RSGinCA
  • Start date Start date
R

RSGinCA

I'm trying to import into a memo field text data which has line breaks (or new
lines, line feeds, or whatever you want to call them), but all those line
breaks get stripped out in the process. And when I experiment, and try to
export data in memo fields which have line breaks, those line breaks are
stripped out.

Is it possible to do this?
Rick G
 
Hi Rick,

You don't mention what you're importing the data from or how you're
doing it.

Text files whose fields contain line breaks are inherently problematic,
because a line break also marks the end of the record in a text file.
IME the only kind of text file in which Access reliably handles data
with line breaks is CSV as follows:

- text fields delimited (qualified) by quotes " "
- line breaks within text fields consist of the two characters
CR LF (Chr(13) & Chr(10)).
- quote marks within text fields are doubled ""
- records are separated by CR LF
 
John,

You were right when you said "You don't mention what you're importing the data
from or how you're doing it." And that reveals the solution to the problem.

I was importing from an html file, and in a program I had made some changes to
the file including changing "<BR>" to a 0x0C/0x0A (carriage return/line feed)
combination. As we all know, a carriage return/line feed is nothing more that
white-space in an html file - that's why there is the <BR> markup character!

Thanks for asking the right question. I couldn't believe that Access was so
primitive that it wouldn't allow that minimal amount of formatting to be
imported into a memo field.

Rick
Subject: Re: Importing text with linebreaks into memo fields
From: John Nurick (e-mail address removed)
Date: 1/10/2004 12:28 AM Pacific Standard Time
Message-id: <[email protected]>

Hi Rick,

You don't mention what you're importing the data from or how you're
doing it.

Text files whose fields contain line breaks are inherently problematic,
because a line break also marks the end of the record in a text file.
IME the only kind of text file in which Access reliably handles data
with line breaks is CSV as follows:

- text fields delimited (qualified) by quotes " "
- line breaks within text fields consist of the two characters
CR LF (Chr(13) & Chr(10)).
- quote marks within text fields are doubled ""
- records are separated by CR LF


Rick G
 
Let me try to reformat my previous message... the BRs in the middle of it
seems to have screwwed it up.

John,

You were right when you said "You don't mention what you're importing the data
from or how you're doing it." And that reveals the solution to the problem.

I was importing from an html file, and in a program I had made some changes to
the file including changing "< B R >" to a 0x0C/0x0A (carriage return/line
feed) combination. As we all know, a carriage return/line feed is nothing more
that white-space in an html file - that's why there is the "< B R >" markup
character!

Thanks for asking the right question. I couldn't believe that Access would be
so primitive that it wouldn't allow that minimal amount of formatting to be
imported into a memo field.

Rick
Subject: Re: Importing text with linebreaks into memo fields
From: John Nurick (e-mail address removed)
Date: 1/10/2004 12:28 AM Pacific Standard Time
Message-id: <[email protected]>

Hi Rick,

You don't mention what you're importing the data from or how you're
doing it.

Text files whose fields contain line breaks are inherently problematic,
because a line break also marks the end of the record in a text file.
IME the only kind of text file in which Access reliably handles data
with line breaks is CSV as follows:

- text fields delimited (qualified) by quotes " "
- line breaks within text fields consist of the two characters
CR LF (Chr(13) & Chr(10)).
- quote marks within text fields are doubled ""
- records are separated by CR LF

Rick G
 
Rick,

Just in case: A line break in Windows is 0x0d0a not 0x0c0a . IIRC 0c is
a form feed.

Access has no problems *storing* characters in memo fields. The standard
textbox control demands 0x0d0a for line breaks but interprets and
displays those just fine, though it can't interpret tabs.

The problem with importing data that includes linebreaks is inherent to
textfiles rather than to Access. Provided the file follows the rules I
described, Access normally manages just fine.
 
Back
Top