.txt to memory

  • Thread starter Thread starter Marty
  • Start date Start date
M

Marty

Hi,

I have a file that contain 100K lines. I want to charge all these lines
to my application memory. I've been using a StreamReader object to read
line by line and process to my app memory, but it is so slow, more than
1.5 min.

How can I speed it up? Does passing from .TXT to XML would make the
transfer faster?

Any idea would be appreciated.

Thanks

Marty
 
if you aren't worried about memory constraints then set you variable =
stream.readtoend() to get all the text at once. see if that speeds things up
a bit. and, no, xml markup will actually increase your file size...


| Hi,
|
| I have a file that contain 100K lines. I want to charge all these lines
| to my application memory. I've been using a StreamReader object to read
| line by line and process to my app memory, but it is so slow, more than
| 1.5 min.
|
| How can I speed it up? Does passing from .TXT to XML would make the
| transfer faster?
|
| Any idea would be appreciated.
|
| Thanks
|
| Marty
 
Marty said:
I have a file that contain 100K lines. I want to charge all these lines
to my application memory. I've been using a StreamReader object to read
line by line and process to my app memory, but it is so slow, more than
1.5 min.

How can I speed it up? Does passing from .TXT to XML would make the
transfer faster?

I doubt that. Maybe it's your processing code that makes reading the file
slow...
 
Finally I used the ReadBlock and it was the best handling for my needs.
I realize that I was able to get greater speed of execution with less
access/refresh of the GUI, then it get pretty fast to process 100000s of
text lines.

Thanks for your help guys.

Marty
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top