I think your problem is that your fields contain spaces. fscanf
will stop scanning a string (%s
) when it sees a white space character. You need to change your %s
format specifiers to allow spaces to be included. You can either just exclude your delimiter, e.g. %[^;]
or specify what characters to include, e.g. %[ a-zA-Z0-9-]
(I think I'd probably go for the first option).
Paul R
2010-05-09 09:19:03