• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 367
  • Last Modified:

Do find and replace Carriage returns in txt

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
0
dba123
Asked:
dba123
  • 2
1 Solution
 
campbelcCommented:
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.
0
 
TomeeboyCommented:
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:

Replace(YourString,"\r","")

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!
0
 
ebrandelCommented:
Here's what I use:

If the string is contained in varString:

varString = Replace(varString,vbCrLf,"")

vbCrLf = visual basic Carriage return Line feed
0
 
ebrandelCommented:
Glad I cold help.
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.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now