Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / October 2007

Tip: Looking for answers? Try searching our database.

parsing text file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Benjamin Fallar III - 17 Oct 2007 07:58 GMT
anybody who has a better idea on parsing a very large text file faster...

and how to determine the number of lines in a textfile?
Vadym Stetsiak - 17 Oct 2007 08:54 GMT
Hello, Benjamin!

Your parser can read file chunks with fixed size. Parser will process these
chunks and update its state.
For instance:
1) read first 512 bytes from the file
2) parse the data with parser, it's state will change (depends on the data
parser is searching for)
3) read another 512 bytes from the file and do step 2

If you're searching for specific constructs in the text you can use regular
expressions for parsing.

To count number of lines, the same approach can be taken:
1) read data chunk
2) scan form newline symbols (\r\n)
3) if found increment newline counter.
--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com

You wrote  on Wed, 17 Oct 2007 14:58:24 +0800:

BFI> anybody who has a better idea on parsing a very large text file
BFI> faster...

BFI> and how to determine the number of lines in a textfile?
Benjamin Fallar III - 22 Oct 2007 15:41 GMT
i'm not interested in chunk of data (in terms of byte size),
in my text file, each line is a record... but my problem is that the size is
almost
more than 28 MB thus, reading, parsing and updating it to CRM database
took almost 1 day to finish.

is there another better solution?

> Hello, Benjamin!
>
[quoted text clipped - 23 lines]
>
> BFI> and how to determine the number of lines in a textfile?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.