none
How to remove Carriage Return and Line Feed in Microsoft Visual Basic 2010

    Question

  • "CustomerName","CustomerID","EmployeeName"CRLF

    "Intel","1234","Dell"CRLF

    "Zen","5467","WindCRLF

    ows"CRLF

    "Microsoft","1256","AppCRLF

    le"CRLF

    How do i remove only these CRLF's and leave the other CRLF's the way it is.

    Basically i would like to remove wherever CRLF's are present within a double quoted field in a text file.

    If it is "WindCRLF

    ows" then it should become "Windows".






    • Edited by FireOfVirgo Thursday, July 18, 2013 7:53 PM
    Thursday, July 18, 2013 6:29 PM

Answers

  • @Andrew: Hello Can you please check now. I am looking for a  VB 2010 code that can do this.

    Oh, I see, changing the question on us, are you? lol :)

    I don't think you can use a TextFieldParser for this, so you may have to resort to examining each character. When a double-quote is encountered, toggle a variable to determine whether or not to include CRLF in the result.

    I have to dash off now, so if you have a go at it and post your code, I expect someone else will come along to give you some help if you can't get it working.

    --
    Andrew

    Thursday, July 18, 2013 8:22 PM

All replies

  • You'll need a VBScript forum - this one is for VB.NET.

    --
    Andrew

    Thursday, July 18, 2013 6:58 PM
  • @Andrew: Hello Can you please check now. I am looking for a  VB 2010 code that can do this.

    Thanks.

    Thursday, July 18, 2013 7:54 PM
  • @Andrew: Hello Can you please check now. I am looking for a  VB 2010 code that can do this.

    Oh, I see, changing the question on us, are you? lol :)

    I don't think you can use a TextFieldParser for this, so you may have to resort to examining each character. When a double-quote is encountered, toggle a variable to determine whether or not to include CRLF in the result.

    I have to dash off now, so if you have a go at it and post your code, I expect someone else will come along to give you some help if you can't get it working.

    --
    Andrew

    Thursday, July 18, 2013 8:22 PM