Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 tokenizeString(string input, string delimiter)

{

size_t pos = 0;

string token;

vector result;

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions

Question

How does the EEOC define sexual harassment?

Answered: 1 week ago