Click here to Skip to main content
15,908,013 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem about the order of SetCaretPos and TextOut Pin
kingliub6-Apr-07 6:54
kingliub6-Apr-07 6:54 
Questiondouble overflow vc++6 Pin
manolomikasa5-Apr-07 6:12
manolomikasa5-Apr-07 6:12 
AnswerRe: double overflow vc++6 Pin
PJ Arends5-Apr-07 8:36
professionalPJ Arends5-Apr-07 8:36 
GeneralRe: double overflow vc++6 Pin
manolomikasa6-Apr-07 7:30
manolomikasa6-Apr-07 7:30 
QuestionDelete records in Recordset in VC Pin
cy163@hotmail.com5-Apr-07 5:39
cy163@hotmail.com5-Apr-07 5:39 
QuestionRe: Delete records in Recordset in VC Pin
David Crow5-Apr-07 5:53
David Crow5-Apr-07 5:53 
AnswerRe: Delete records in Recordset in VC Pin
krmed5-Apr-07 7:22
krmed5-Apr-07 7:22 
QuestionHow to speed up copy of .txt files into arrays? Pin
Arris745-Apr-07 5:25
Arris745-Apr-07 5:25 
Hello

I use a Text file with following structure with about 4 millions lines and the separator is a ‘\t’ (tabulation).

"Date" "Time" "Signal"
20000103 1658 351
20000103 1659 352
20000103 1700 350
20000103 1701 352
20000103 1702 355
20000104 0900 354
20000104 0901 352
20000104 0902 350

I would like to copy the columns Date, Time and Signal into a STL vectors containers.
But I do not want to copy all the file. For example a just need to start at line 250000 and stop at line 3000000. The criteria to define the line where to start and finish copying is the column Date and Time

I currently use CFile and I copy the whole file into a buffer and I close the file.
This is very fast, less than 1 second.

Then I use the function strtok to read the buffer string by string.
And I count the lines until I find the date and time thatI want.
Unfortunately my method takes 57 seconds to cross all the file just to pick up the start and end line numbers.
So I am wondering if is there is a possibility to read the buffer or a file column by column?
Does someone knows or heard a method to swiftly read a string buffer or a file?
I thank you very much If you can advice solutions that help to speed up this process.

For information, I tested the function Tokenize of CString but is is very slow.
I also tested CStdioFile and ReadString function but it is also very slow.

AnswerRe: How to speed up copy of .txt files into arrays? Pin
led mike5-Apr-07 5:32
led mike5-Apr-07 5:32 
AnswerRe: How to speed up copy of .txt files into arrays? Pin
Arris745-Apr-07 5:55
Arris745-Apr-07 5:55 
AnswerRe: How to speed up copy of .txt files into arrays? Pin
David Crow5-Apr-07 6:01
David Crow5-Apr-07 6:01 
GeneralRe: How to speed up copy of .txt files into arrays? Pin
Arris745-Apr-07 6:20
Arris745-Apr-07 6:20 
GeneralRe: How to speed up copy of .txt files into arrays? Pin
led mike5-Apr-07 6:28
led mike5-Apr-07 6:28 
GeneralRe: How to speed up copy of .txt files into arrays? Pin
Arris745-Apr-07 7:17
Arris745-Apr-07 7:17 
GeneralRe: How to speed up copy of .txt files into arrays? Pin
malaugh5-Apr-07 10:55
malaugh5-Apr-07 10:55 
GeneralRe: How to speed up copy of .txt files into arrays? Pin
Arris745-Apr-07 11:14
Arris745-Apr-07 11:14 
GeneralRe: How to speed up copy of .txt files into arrays? Pin
David Crow5-Apr-07 6:32
David Crow5-Apr-07 6:32 
GeneralRe: How to speed up copy of .txt files into arrays? Pin
Arris745-Apr-07 7:19
Arris745-Apr-07 7:19 
GeneralRe: How to speed up copy of .txt files into arrays? Pin
PJ Arends5-Apr-07 8:00
professionalPJ Arends5-Apr-07 8:00 
GeneralRe: How to speed up copy of .txt files into arrays? Pin
David Crow5-Apr-07 8:15
David Crow5-Apr-07 8:15 
GeneralRe: How to speed up copy of .txt files into arrays? Pin
led mike5-Apr-07 8:54
led mike5-Apr-07 8:54 
GeneralRe: How to speed up copy of .txt files into arrays? Pin
Arris745-Apr-07 9:20
Arris745-Apr-07 9:20 
GeneralRe: How to speed up copy of .txt files into arrays? Pin
Arris745-Apr-07 9:33
Arris745-Apr-07 9:33 
QuestionSCSI_PASS_THROUGH_DIRECT problems Pin
FoxholeWilly5-Apr-07 5:07
FoxholeWilly5-Apr-07 5:07 
QuestionWMI Pin
saisp5-Apr-07 4:48
saisp5-Apr-07 4:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.