Hi I was trying to count rows and columns in a tab delimited flat file.
Like here in example below i should be able to detect automatically the no of rows and columns.
So I should get 5 columns and 6 rows. Something like that.
one two three four five
one two three four five
one two three four five
one two three four five
one two three four five
one two three four five
I am reading my file like this:-
string str[0];
int i=0;
while(!myFile.eof())
{
getline(myFile, str[i], '\n');
vec.push_back(i);
}
Is this the correct way ?
I need to get the rows and columns for any files for which I may not know these details.
Thanks