hi all
i want to read a secific line in a text file
here is the text file form

iphuc 0.6.1 with tab completion.
>> By The iPhoneDev Team: nightwatch geohot ixtli warren nall mjc operator
Unsupported iTunesMobileDevice.dll Version ee0000 15
CFRunLoop: Waiting for iPhone.

or

iphuc 0.6.1 with tab completion.
>> By The iPhoneDev Team: nightwatch geohot ixtli warren nall mjc operator
Unsupported iTunesMobileDevice.dll Version ee0000 15
notification: iPhone attached.
CFRunLoop: Waiting for iPhone.
AMDeviceStartService 'com.apple.afc': 0
deviceinfo:
FSFreeBytes: 14891978752
Model: This is changed
FSTotalBytes: 15527268352
FSBlockSize: 4096

i want it to write the model value in textbox1 so anyone pls help me

Member rule:

  • Do provide evidence of having done some work yourself if posting questions from schoolwork assignments

Open up the file in an ifstream, read with getline(istream& is, string& str).

Well you can try this:

while (count != required_line) {
    getline(----); // appropriate arguments
    count++;
}

getline

And i agree with MosaicFuneral. Post whatever code you have already written

It would probably be best if you posted what you had so we could see what you need to change but you could use std::vector then use the vector to access a specific line

string n;
vector <string> v;
while (getline( myfile, n ))
{
v.push_back( n );
}
cout << "line 9 = " << v[ 9 ] << endl;

hope you can sync this with what you have

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.