F
friend.blah
Could anyone give a simple idea in solving this
i have a text file which has several millions of lines consisting
around 5 coloums
for example
12345
456789101187837
12536536657588968590680568
36736473647
454785678475767856756
......
the length of string in each line is diffrent...
so when i first read my file i want to take only first line....
when i read it for the second time i want second line skipping the
first line....and so on..
till now what i was doing is
int lineCounter = 1; //declared in initialize function
int row = 1;
bool check = true;
ifstream filein("xxx.txt");
while(check)
{
while(row < LineCounter)
{
filein.ignore(26,'\n'); //here what i am doing is i am
entering the line which has maximum number of characeters .i.e., in
the example my 3rd line has maximum number of characters i.e., 26
row++;
}
getline(filein,Input);
check = false;
}
but i cant check it in file which has millions of lines...
so please tell me smart way to approach this
thanks to all
i have a text file which has several millions of lines consisting
around 5 coloums
for example
12345
456789101187837
12536536657588968590680568
36736473647
454785678475767856756
......
the length of string in each line is diffrent...
so when i first read my file i want to take only first line....
when i read it for the second time i want second line skipping the
first line....and so on..
till now what i was doing is
int lineCounter = 1; //declared in initialize function
int row = 1;
bool check = true;
ifstream filein("xxx.txt");
while(check)
{
while(row < LineCounter)
{
filein.ignore(26,'\n'); //here what i am doing is i am
entering the line which has maximum number of characeters .i.e., in
the example my 3rd line has maximum number of characters i.e., 26
row++;
}
getline(filein,Input);
check = false;
}
but i cant check it in file which has millions of lines...
so please tell me smart way to approach this
thanks to all