TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jerry Fike
NA
107
0
Text Files -- Extracting Data
Jan 7 2010 2:26 PM
I am working on some code to extract some blocks of text data from rather large files. In one file, there are 13 blocks of text ranging from around 30,000 to 150,000 bytes. I was using the simple code below to extract and record the data into one block, but it seems extremely slow (several minutes.) Since it reads into
filebuffer
from disk in a couple of seconds, it was surprising to me it takes so long to transfer out the blocks of data, especially considering the start and end positions are already identified.
Is there a better way to do this to gain some speed?
for (int i = 0; i < tgoBlockCount; i++)
{
for (int j = tgoBlockStart[i]; j < tgoBlockEnd[i]; j++)
{
tgoBlock += fileBuffer[j];
}
}
Reply
Answers (
1
)
Difference between static & sealed class
About socket programming