473,379 Members | 1,190 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Reading text from file using ReadLine method

CD
Hi,

I am getting a problem using the following piece of code:

Dim strfile As Object
Set strfile = FSO.OpenTextFile(stFilePath, 1)
Do While Not strfile.AtEndOfStream
strtext = strfile.ReadLine
Loop

Whenever the character count of the line goes in excess of 130, only the
131st character onwards are displayed. Any pointers?

CD
Nov 21 '05 #1
3 5780
This snippet of code is completely late bound and is using the old Scripting
Runtime Library methods to read the file. You should use the objects
provided in the System.IO namespace if you are programming with .Net. Take
a look at the StreamReader object.

--Robby

"CD" <CD@discussions.microsoft.com> wrote in message
news:DC**********************************@microsof t.com...
Hi,

I am getting a problem using the following piece of code:

Dim strfile As Object
Set strfile = FSO.OpenTextFile(stFilePath, 1)
Do While Not strfile.AtEndOfStream
strtext = strfile.ReadLine
Loop

Whenever the character count of the line goes in excess of 130, only the
131st character onwards are displayed. Any pointers?

CD

Nov 21 '05 #2
CD
Hi,
Thanks for the advice but i am programming in VB6.0 and not in .NET, so
unfortunately i cannot use the methods in System.IO namespace.
I would be happy if you could let me know if the ReadLine method
encounters some problem when the length of the line is more than 131 chars
and how i can overcome it.

Thanks
CD
Nov 21 '05 #3
CD,

This is a VBNet newsgroup.
Although the the name is as well VB it has almost completly different code.

For VB classic there are a lot of newsgroups.

microsoft.public.vb*

The most active is as far as I know

microsoft.public.vb.generaldiscussions.

I hope this helps?

Cor

"CD" <CD@discussions.microsoft.com>
Hi,
Thanks for the advice but i am programming in VB6.0 and not in .NET,
so
unfortunately i cannot use the methods in System.IO namespace.
I would be happy if you could let me know if the ReadLine method
encounters some problem when the length of the line is more than 131 chars
and how i can overcome it.

Thanks
CD

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Simon Verona | last post by:
Not sure if this is the best group... it may be better off in one of the ADO groups, but I'm sure somebody here knows the answer: I'm trying to load up a text file using ADO.net, as follows: ...
1
by: JM | last post by:
Hi, I have been trying to read a file, using "StreamReader" to pass the info to an string that is: ....dim stream as new FileStream(file,...) dim sr as new StreamReader(stream) dim data as...
0
by: neerajdeswal | last post by:
Testing Soap envelop (as Text File) in RPC Method Hi, I have created a web service based on a interface contract given by client. Now client wants to test it based on a given...
4
by: varsha desai | last post by:
Hello there, I want to change some data(which is in one line only) of text file using VB 6.0. Which is the best method for it? Another question is I want to delete last two, three lines...
3
by: jasvinder singh | last post by:
Respected Sir/madam, Can you help in providing code in 'C' for Reading text file with n number of rows and columns and putting the result in arrays.The sample file is as follows: rim_label =...
1
by: raghudr | last post by:
Hi all, I am parsing an .xml file.My main intention is to retrieve the field value:- "Name Value" which is "rag" and store it in a List. Fot that i wrote code like this: //i am using...
1
by: spiralfire | last post by:
I'm writing a parser, and im totally confused. Its apparently correct, but something is happening: I do a fread command to a char array of the entire file (it isn't big), this is the file: ...
2
by: Rakulkumar | last post by:
how can i print the pdf file using binarywrite method in asp.i can print the text file using Response.binarywrite method but i cnat print the pdf files
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.