You can do this using sscanf as below. But you should know the format of each line. here we assume that lines either get formatted like
"line:30,"
or
num0=1
so we write our code as below
CString csLine; int c, d;
if( !sscanf( csLine, "num%d=%d", &c, &d ) {
if( !sscabf( csLine, "line:%d", &c ) {
}
}
hope you got the idea