Do find and replace Carriage returns in txt

Posted on 2006-03-29
Last Modified: 2008-03-17
I have a txt which has a bunch of extra carriage returns.  Below is an example of part of it. How can I get rid of the blank rows?

"4264294999330246","1","0600355","06",20060208,20060209,"02","","4914 PEPYS LN APT A","284032839","000002494DFDF","NC","NEW FDFD","CsFE","JADFD","HDFDFDEIN","AKA DFDF","","","","WILMINGTON","NC","S","DFD","DFD

"4264294999330246","1","0600355","06",20060208,20060209,"02","","4914 PEPYS LN APT A","284032839","000002494","WILSON","NC","NEW HADFDR","DFD","JDFD","HDFDF","AKA DFD","","","","WILMINGTON","NC","S","DFDPC","DFDSR","5725 OLDFFDR DR STE

"4264294999330246","1","0600355","06",20060208,20060209,"02","","4914 PEPYS LN APT A","284032839","SS","NEW "4264294999330246","1","0600355","06",20060208,20060209,"02","","SSLN APT A","284032839","SSNEW GSRYS "4264294999330246","1","0600355","06",20060208,20060209,"02","","4914 PEPYS LN APT A","284032839","000002494","SSNC","NEW HASSVER","CASSE","JASSNESS","SS","","","","SSINGTON","NC","S","SSPC","SS
Question by:dba123
    LVL 6

    Expert Comment

    Depending on the language you are using for this, you would want to look for Chr(13) and Chr(10) and delete them. Chr(13) and Chr(10) are carriage return and line feed.
    LVL 15

    Expert Comment

    Are you wanting to do this in ASP/Vbscript?  That's what I'm guessing from your other questions.  I'm pretty sure you could just use the Replace function, like so:


    You might need to do:

    Replace(YourString,"\r\n","") if these are Windows carriage returns.

    If you still end up with extra white space that you want completely removed:

    Replace(YourString," ","")

    Hope that helps!
    LVL 1

    Accepted Solution

    Here's what I use:

    If the string is contained in varString:

    varString = Replace(varString,vbCrLf,"")

    vbCrLf = visual basic Carriage return Line feed
    LVL 1

    Expert Comment

    Glad I cold help.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    The first time you look at a web page and its source code, you are probably a little intimidated by the use of symbols and jargon that really looks foreign to you. You might not even know where to start to begin learning what it all means. That’…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
    This video teaches users how to migrate an existing Wordpress website to a new domain.

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now