Question
I have a file-config .txt ----------------------------------------------------------------------- //1 The range of 'horizontal' indices, inclusive //2 E.g. if the range is 0-4, then the indices are 0,
I have a file-config .txt
-----------------------------------------------------------------------
//1 The range of 'horizontal' indices, inclusive //2 E.g. if the range is 0-4, then the indices are 0, 1, 2, 3, 4 GridX_IdxRange=0-8
//3 The range of 'vertical' indices, inclusive //4 E.g. if the range is 0-3, then the indices are 0, 1, 2, 3 GridY_IdxRange=0-8
// [x,y] grid-areas which are occupied by cities citylocation.txt
// "next day" forecasted cloud coverage (%) for // each [x,y] grid-area cloudcover.txt
// "next day" forecasted atmospheric pressure intensity (%) for // each [x,y] grid-area pressure.txt ------------------------------------------------------------------------------------------
//declaration
vector
{
size_t pos = 0;
string token;
vector
while ((pos = input.find(delimiter)) != string::npos)
{
token = input.substr(0, pos);
result.push_back(token);
input.erase(0, pos + delimiter.length());
}
result.push_back(input);
return (result);
}
----------------------------------------------------------------------
how do i get these out? using something like this:
tokenStringVector = tokenizeString(GridXRange, "=="); //GridX_IdxRange
cout << endl;
GridXRange = tokenStringVector[0]; //0-8
cout << endl;
for (int i = 0; i < tokenStringVector.size(); i++)
cout << tokenStringVector[i] << endl;
cout << endl;
cout << endl;
---------------------------------------------------------------------------
I want the values such as
GridX = 0-8
GridY = 0-8
and so on.
i want to skip the line 1 then line 2 and i want the part of line 3 to be stored as a variable
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started