Import Export Problems

P

propolis

Hi

Would like some advice please :D

I am importing a .csv file generated with excel. Now when I impor
this file into access, the text in my memo field has line breaks i
it. When access imports this files it ignores the excel line brea
codes.

The same happens when I export from access a .csv file

In excel and access the codes for line breaks are different.

Does anyone know of a workaround for this problem

Cheers :lol
 
J

John Nurick

Excel uses LF, Chr(10) for line breaks within cells, while Access uses
the Windows-standard CRLF, Chr(10) & Chr(13).

All you need do is run an update query after importing (or before
re-exporting) that uses the Replace() function to change the line
breaks, e.g.

UPDATE MyTable
SET MemoField = Replace([MemoField],Chr(10),Chr(10) & Chr(13));

On Thu, 16 Jun 2005 19:39:54 -0500,
 
D

Douglas J. Steele

Slight correction. Access uses Chr(13) & Chr(10), not Chr(10) & Chr(13)

UPDATE MyTable
SET MemoField = Replace([MemoField],Chr(10),Chr(13) & Chr(10))


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



John Nurick said:
Excel uses LF, Chr(10) for line breaks within cells, while Access uses
the Windows-standard CRLF, Chr(10) & Chr(13).

All you need do is run an update query after importing (or before
re-exporting) that uses the Replace() function to change the line
breaks, e.g.

UPDATE MyTable
SET MemoField = Replace([MemoField],Chr(10),Chr(10) & Chr(13));

On Thu, 16 Jun 2005 19:39:54 -0500,
Hi,

Would like some advice please :D

I am importing a .csv file generated with excel. Now when I import
this file into access, the text in my memo field has line breaks in
it. When access imports this files it ignores the excel line break
codes.

The same happens when I export from access a .csv file.

In excel and access the codes for line breaks are different.

Does anyone know of a workaround for this problem.

Cheers :lol:
 
J

John Nurick

Slight correction. Access uses Chr(13) & Chr(10), not Chr(10) & Chr(13)

UPDATE MyTable
SET MemoField = Replace([MemoField],Chr(10),Chr(13) & Chr(10))

Thanks, Doug. I must have been having a particularly left-handed moment.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top