I am trying to read in data from a file that is formatted with ;
.
The data will always be of like this:
char[];int;int%;int
The char[]
can have any number of spaces and the %
should be disregarded when reading the data.
I am using fscanf()
(I am allowed to use only that) for reading the data from the file.
Right now my code for that part of it is:
fscanf(file, "%[^;]%d%d%d", f_name, &f_id, &f_score, &f_section_num) != EOF)
Is there a regex for what I need? Or, how do I correct my fscanf
?