Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Answer
Text Files -- Extracting Data
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Jerry Fike
14y
2.9k
1
Reply
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];
}
}
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Difference between static & sealed class
About socket programming