Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-04-11
4
Medium Priority
?
828 Views
Last Modified: 2013-12-25
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?
0
Comment
Question by:TimHietanen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 18

Accepted Solution

by:
Sethi earned 1000 total points
ID: 24124613
You can use the Replace function this way:
Replace(Yourfieldname," & chr(13)  & ","")
0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 24126261
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
 

Author Closing Comment

by:TimHietanen
ID: 31569274
Thanks for the input. Worked perfectly.
0
 
LVL 53

Expert Comment

by:strung
ID: 24685683
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

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question