473,395 Members | 1,583 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,395 software developers and data experts.

Readline method does not return entire line

Hi,

I am using the readline method in an application. The problem that creeps up
is that for some particular line of text, even though it is < 512 characters,
this method returns text only from the 130th character onwards or
thereabouts. The file in question that I'm scanning is a txt format of stored
procedures.

Regards,
Piyush
Nov 21 '05 #1
3 1204
Piyush,

Can you read that file using notepad?

Or other question, can you read the whole file in one time with readtoend?

http://msdn.microsoft.com/library/de...toendtopic.asp

Cor
"Piyush" <Pi****@discussions.microsoft.com>
Hi,

I am using the readline method in an application. The problem that creeps
up
is that for some particular line of text, even though it is < 512
characters,
this method returns text only from the 130th character onwards or
thereabouts. The file in question that I'm scanning is a txt format of
stored
procedures.

Regards,
Piyush

Nov 21 '05 #2
As a matter of fact, I can. I've been stuck on this problem for quite some
time now.

Regards,
Piyush

"Cor Ligthert" wrote:
Piyush,

Can you read that file using notepad?

Or other question, can you read the whole file in one time with readtoend?

http://msdn.microsoft.com/library/de...toendtopic.asp

Cor
"Piyush" <Pi****@discussions.microsoft.com>
Hi,

I am using the readline method in an application. The problem that creeps
up
is that for some particular line of text, even though it is < 512
characters,
this method returns text only from the 130th character onwards or
thereabouts. The file in question that I'm scanning is a txt format of
stored
procedures.

Regards,
Piyush


Nov 21 '05 #3
Piyush wrote:
As a matter of fact, I can. I've been stuck on this problem for quite some
time now.

Regards,
Piyush


How was this file created? Exported from the SQL Enterprise manager?
Sounds like there is a rogue character in there, like an extra linefeed
or newline, somewhere that makes the readline command puke. Maybe you
could post (or upload to a site) the textfile so people can take a look
at it if you don't mind them seeing the procedure.

--
Rinze van Huizen
C-Services Holland b.v.
Nov 21 '05 #4

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

Similar topics

6
by: Russell E. Owen | last post by:
At one time, mixing for x in file and readline was dangerous. For example: for line in file: # read some lines from a file, then break nextline = readline() # bad would not do what a naive...
8
by: Danny Smith | last post by:
Hi, I need to read a file and be able to: 1. Find the current position in the stream 2. Have access to a handy ReadLine() method. Obviously the FileStream class supports random access, so...
8
by: Scott | last post by:
Hi guys, If I try to call read(), readline(), readtoend() and there is nothing to read (from a never ending loop for example) the program seems to continue but it exits the loop for no apparent...
2
by: Jan | last post by:
Hello there, I've got a strange problem using the readline method in vb2005 for reading the serial port. If I use the readchar method I can receive one character from serialport. This is the...
1
by: mike.biang | last post by:
I am using the textstream object to read a CSV file and parse through the fields. I use the readline() method to read in each line of the file, and parse the contents into the values of the...
0
by: 7stud | last post by:
Hi, 1) Does this make any sense: """ Thus, the loop: for line in f: iterates on each line of the file. Due to buffering issues,
21
by: John Henry | last post by:
Hi list, I have a need to create class methods on the fly. For example, if I do: class Dummy: def __init__(self): exec '''def method_dynamic(self):\n\treturn self.method_static("it's...
5
by: kj | last post by:
I'm trying to subclass file, overriding the readline method. The new method definition begins with def readline(self, size=None): line = self.file.readline(size) # etc., etc. ....where the...
6
by: Sean Davis | last post by:
I have a large file that I would like to transform and then feed to a function (psycopg2 copy_from) that expects a file-like object (needs read and readline methods). I have a class like so: ...
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: 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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.