Answer the question
In order to leave comments, you need to log in
How to read individual parts of a text file in C++?
There is a text file of this kind (only there are much more lines):
How to read individual columns from this file? (specifically - 2,3 and 10)
Answer the question
In order to leave comments, you need to log in
Read line by line, parse the line, take the required columns and work with them. No other way.
most likely you need to parse this tex. You read it line by line and as soon as you meet a space in the line, you throw a read piece (from the previous space) into a separate array. And so with all the lines. As a result, you will get a certain number of arrays, each of which will be a column from your text. As an option
The easiest option.
while (std::getline (file,line)){
//Для VC++ sscanf_s
sscanf(line.c_str(),"%*s %x %x %*x %*x %*x %*x %*x %*x %x", &stolbec_2,&stolbec_3,&stolbec_10);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question