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
Re: text file "carriage return at end of every line"
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
Re: text file "carriage return at end of every line"
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
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)
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))
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
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.
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.