I am trying to read a file that is filled with ints and strings. The file starts with 1 string followed by 2 ints (this is always the case). Then the rest of the data in the file is strings (this can range from 1 string to hundreds). I want to store the first string into a variable and the two ints into their own separate variable and the strings into an array.
I initially tried using fscanf but sense the file can contain an arbitrary number of strings after the 2 ints. I figured this would not work. I am now thinking that I need to somehow parse the data / tokenizing the data. Any ideas would be appreciated.
DATA FILE
S11FREE
2
0
(A,B)(C,D)
(E,F)(G,H)
(I,J)(K,L)
(M,N)(O,P)
...
...
...
...
(...) as in more strings in the same format