Home > Software engineering >  Read about MFC TXT text data to the list control
Read about MFC TXT text data to the list control

Time:09-16

How big the data is read in the TXT file to the list control, it is better for specific code!
TXT text format below

Want to have it read one by one to the list control in the corresponding cell

The great god give a complete code, thank you!

CodePudding user response:

How are you getting along with yt804859620 classmates? Why don't you talk to

CodePudding user response:

What do you mean? Communicate with you?

CodePudding user response:

CStdioFile class, ReadString line read, read each row are separated by commas

CodePudding user response:

Fopen_s
_fgetts
_tcstok_s
Fclose

CodePudding user response:

How to read TXT file, online search can find casually, as to how to storage, output, according to the demand for it

CodePudding user response:

My is that according to the "change", it only shows the first row, the second line does not display the

My code is

How to modify, it is better to specific points, I'm just learning, do not understand! Thank you very much!

CodePudding user response:

 while (file_1 ReadString (Content)) 
{
//data processing here
}

CodePudding user response:

Reading file example
Cstrings szLine="";

//open the file

CStdioFile file;

Tests. TXT file. Open (" ", CFile: : modeRead);

//read line by line string
Int I=0;
While (file. ReadString (szLine))

{

//the szline to join you in the interface of the ith row line

}



//close the file

File. The Close ();

CStdioFile class declaration to save afx again. H header file,

CodePudding user response:

refer to the eighth floor yuanningcz response:
read file example
Cstrings szLine="";

//open the file

CStdioFile file;

Tests. TXT file. Open (" ", CFile: : modeRead);

//read line by line string
Int I=0;
While (file. ReadString (szLine))

{

//the szline to join you in the interface of the ith row line

}



//close the file

File. The Close ();

CStdioFile class declaration to save afx again. H header file,

Concrete is what meaning, I also disturbed by this, the first line is what

CodePudding user response:

refer to 6th floor fuye2803 response:
my so, press the "change", it only shows the first row, the second line does not display the

My code is

How to modify, it is better to specific points, I'm just learning, do not understand! Thank you very much!

The elder brothers you can display multiple lines now

CodePudding user response:

B: yes, you can! In the circular

CodePudding user response:

Specific display multi-line complete code can send me see

CodePudding user response:

Can read one line, find mid insert recycling line

CodePudding user response:

What good method?

CodePudding user response:

https://blog.csdn.net/linux5blue19/article/details/6173099

CodePudding user response:

You only read one line, one line of data, of course, in addition, logic has a problem, change
File_1. SeekToBegin ();//this sentence and move to the front, if open the file for the first time, didn't also can
While (file_1. ReadString)
{
Code to move in
//listcontrol inside make a adjust operation according to the number of entering the while
}
File_1. Close ();
  • Related