ASCII file without crlf's

A

Andrew

Hello. I am working with very large files in my .NET project (1
million plus records). Some of these files do not have crlf's, which
makes it very hard to read the file without a layout or record length.
In my application, I would like to open one of these text files and
check to see if it contains crlf's before proceeding in my code. I
tried using the streamreader, but readline() cancels out with a memory
error because it thinks the ENTIRE file is the first record since there
are no crlf's. I have also tried FSO, but I get a server timeout.

Is there any easy way to check for crlf's with large files like these?

Thanks!
 
N

Natty Gur

Hi,

I think that whatever you will do will need to go through the file (to
find crlf). what i suggest is to use pre task to check files (like
monitoring directory for new files and check them ).

HTH
Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)52-8888377


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
M

M. Zeeshan Mustafa

Andrew,

Did you try using StreamReader.Read to read
character by character? I think you can use it with some tricks
and then get your work done.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top