I have unfamiliar issues of fscanf delimiter on C.
The data.txt is below.
k:01062003200:0222005000:G5
g:01034567800::G7
n:01068003200:0222000000:G6
m:01023450987::
As you can see, it is not always that data are written between delimiters ':'
but I have to load it anyway even it's ""
.
fscanf(fileName, "%[^:]:%[^:]:%[^:]:%s", name, phone1, phone2, memo)
This is my code only worked well with a line that no blank between delimiters.
How can I load them all?