|
-
May 28th, 2007, 03:24 PM
#1
Thread Starter
Addicted Member
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
-
May 28th, 2007, 03:29 PM
#2
Re: text file "carriage return at end of every line"
-
May 28th, 2007, 03:36 PM
#3
Thread Starter
Addicted Member
Re: text file "carriage return at end of every line"
 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.
-
May 28th, 2007, 03:39 PM
#4
Re: text file "carriage return at end of every line"
-
May 28th, 2007, 03:42 PM
#5
Thread Starter
Addicted Member
Re: text file "carriage return at end of every line"
 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
-
May 28th, 2007, 03:45 PM
#6
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)
-
May 28th, 2007, 03:49 PM
#7
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))
-
May 28th, 2007, 03:55 PM
#8
Thread Starter
Addicted Member
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
-
May 28th, 2007, 04:14 PM
#9
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.
-
May 28th, 2007, 04:14 PM
#10
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|