How do I remove a carriage return from a text field when adding to a csv file?

I'm pulling records from a table and adding them to a csv file. Some of the comment fields have carriage returns in them which is screwing up the format of the csv file. How can I remove the carriage returns and make the comment field one continuous string?
TimHietanenAsked:
Who is Participating?
 
SethiConnect With a Mentor Commented:
You can use the Replace function this way:
Replace(Yourfieldname," & chr(13)  & ","")
0
 
Patrick MatthewsCommented:
Hello TimHietanen,

Is it *only* a carriage return (Chr(13)), or is it the carriage return plus line break (Chr(13) & Chr(10); aka vbCrLf)?

You may want to try Replace(SomeColumn, Chr(13) & Chr(10), "")

Regards,

Patrick
0
 
TimHietanenAuthor Commented:
Thanks for the input. Worked perfectly.
0
 
strungCommented:
OS X follows the Unix convention of using only the carriage return Chr(13) and not the line feed (Chr10):

http://www.websiterepairguy.com/articles/os/crlf.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.