Sscanf arguments limitation

Hey ROOTers !

I’m trying to read data from an ASCII file using the sscanf function, but since it contains more than 20 specific columns of data, it doen’t seem to work, I get this error :

Limitation: sscanf only takes upto 12 arguments HVana3_1.C:549:

Here’s what it looks like :

while (fgets(&line,200,fp)) {
if (strlen(line) < 10) continue;

I’m new to ROOT and C++, does anyone have an idea of what I could do ?

Thanks. Cheers.

see an example using ifstream instead of sscanf at … tml#auO86E

and note that TNtupleD::ReadFile or TTree::readFile is probably the solution
to your problem without having to code yourself this task.
See also tutorials at
$ROOTSYS/tutorials/tree/basic.C, basic2.C and cernbuild.C