Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

export memo field

Status
Not open for further replies.

FB9

Technical User
Oct 14, 2006
9
US
I need to export a database to a .csv file; it includes two memo fields. I've tried "copy to... deli", and "list" with a user function to add the quotes and commas, but carriage returns in the memo fields seem to cause problems... it wants to create a new record in the .csv file when a CR is encountered. How can I accomplish this??!
 
Hi

A CSV file tends to work on the basis that there is one record per line - and a carriage return qualifies as a line break, so your memo field are going to need a little stroking to get them just so.

Before you export your data, replace all the memo's with something like this:

Code:
replace all myMemoFld with StrTran(myMemoFld,CHR(13)+CHR(10),"\n\r")

Assuming that you are confident there are no \n\r entries in the memos already!

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Thanks, I was afraid I'd have to do something like that. But, I thought enclosing the whole memo field in quotes would take care of the problem. Evidently it doesn't.

Since I'm importing the memo fields into another database, I assume I'd need to replace the \n\r with chr(10) and chr(13) once it's imported...

Frank
 
You might need to be a bit more sophisticated and look for \n\r and replace that with something... you follow I'm sure.

But yes.

And watch for lines that just end with a chr(13) or a chr(10)!


Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top