Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TextStream readline limitation to 60 Characters

240 views
Skip to first unread message

Gerd Paysan

unread,
Jul 5, 2012, 10:16:18 AM7/5/12
to
Hi,

I'm using TextStream Object Readlint to read the Lines of a file using the code below. However it seams, that every Line is limited to 60 Characters. Does anybody know a reason for this. Linefeed is 0D 0A (Windows).

Thsnks

Gerd

set fsf = CreateObject("Scripting.FileSystemObject") set f = fsf.OpenTextFile(File.path ,1)

' File Loop
Do Until f.AtEndOfStream
l = f.ReadLine

Mayayana

unread,
Jul 5, 2012, 10:54:18 AM7/5/12
to
There's no such limit. You might want to look at the
file in a hex editor to confirm it's valid format. Otherwise,
you haven't explained enough about what you're doing
for anyone to help. Also, it helps if you post the actual
code you're using. The code you posted can't be it, since
it doesn't show the length testing or the "Loop" line.

A tangential point: In many cases it makes more sense
to do a ReadAll, Then if you want lines you can get them
with Split(s, vbCrLf).

Dave "Crash" Dummy

unread,
Jul 5, 2012, 12:40:16 PM7/5/12
to
Gerd Paysan wrote:
> Hi,
>
> I'm using TextStream Object Readlint to read the Lines of a file
> using the code below. However it seams, that every Line is limited to
> 60 Characters. Does anybody know a reason for this. Linefeed is 0D 0A
> (Windows).
>
>
> set fsf = CreateObject("Scripting.FileSystemObject")
> set f = fsf.OpenTextFile(File.path ,1)

>
> ' File Loop
> Do Until f.AtEndOfStream
> l = f.ReadLine

I have used that code (completed) many times and have never run into a
line length limit.

Incidentally, if you already have a file object, you don't need to
create a new one to read it.

set ts=File.OpenAsTextStream(forReading)
do until ts.AtEndOfStream
line=ts.ReadLine
loop

--
Crash

"When you get to a fork in the road, take it."
~ Yogi Berra ~

Todd Vargo

unread,
Jul 5, 2012, 1:29:12 PM7/5/12
to
On 7/5/2012 10:16 AM, Gerd Paysan wrote:
> set fsf = CreateObject("Scripting.FileSystemObject")
> set f = fsf.OpenTextFile(File.path ,1)
>
> ' File Loop
> Do Until f.AtEndOfStream
> l = f.ReadLine

Your code is missing vital information. To get help with your problem,
post the exact code that exhibits the problem. A sample of the text (or
background on it) that you are trying to read would be helpful.

Are you actually trying to read a text file? Or is some form of database
or other binary file that may be broken into 60 byte records? The
.ReadLine method does not have such a character limit, so we need to see
what you are doing and understand how you have determined that you are
seeing a 60 character limit.

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)


0 new messages