Results 1 to 10 of 10

Thread: text file "carriage return at end of every line"

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    218

    text file "carriage return at end of every line"

    i have written a program which dloads data from a website and saves it to a text file. now a problem is i need to have that data on seprate line and the text file has a box like seprator at end of each line

    how do i make my program identify the box as a end of line and put the data on seprate line

    im attaching the output text file here with the post

  2. #2
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: text file "carriage return at end of every line"

    Where's the box?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    218

    Re: text file "carriage return at end of every line"

    Quote Originally Posted by zynder
    Where's the box?

    see the attached txt file


    http://www.vbforums.com/attachment.p...4&d=1180383844
    Last edited by rohitb; May 28th, 2007 at 03:39 PM.

  4. #4
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: text file "carriage return at end of every line"

    I dont see any box.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    218

    Re: text file "carriage return at end of every line"

    Quote Originally Posted by zynder
    I dont see any box.

    didnt u dload the http://www.vbforums.com/attachment.p...4&d=1180383844

    attachment

    abb.ns.txt

    now im attaching a screenshot

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: text file "carriage return at end of every line"

    That is most likely either a vbCr (carriage return) or vbLF (Line Feed) character.. you just need to replace that with both combined, eg:
    Code:
    myText = Replace(myText, vbCr, vbCrLf)
    (if that doesn't work, change vbCr to vbLF)

  7. #7
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: text file "carriage return at end of every line"

    Do you know the ascii code for that square box? I haven't encounter something like this but I think if you can figure out the ascii for that, it is possbile to use as a delimiter in Split() function.

    dim myArr() as string

    myArr = Split(YourTextHere, Chr(the ascii code here for box))

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    218

    Re: text file "carriage return at end of every line"

    Oh And The Fun About The Boxes Is If I Try Pasting The Content Here Directly They Dont Show Nor Do The Show If I Open In Ms Word

  9. #9
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: text file "carriage return at end of every line"

    It must be a carraige return on what Si is pointing out. If so you can separate it using VbCr as your delimiter.

  10. #10
    Member
    Join Date
    May 2007
    Posts
    60

    Re: text file "carriage return at end of every line"

    The little "box" is a linefeed (ASCII 10) so just do as si_the_geek says and replace it with vbCrLf. It then formats fine in a regular multi-line Textbox.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width