note 22958 rejected from function.sscanf by didou
| From: | didou@php.net | Date: | Fri, 03 Oct 2003 11:22:31 +0000 |
| Subject: | note 22958 rejected from function.sscanf by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57699@lists.php.net to get a copy of this message | ||
Note Submitter: dycker@wiwi.hu-berlin.de
----
i am trying to parse a literature-file with articles, books, conference-proceedings in different
formats.
x(Agha, M., Branker, D. S.) (1997), Maximum Likelihood Estimation and Goodness-of-fit Tests for
Mixtures of Distributions, Applied Statistics, Vol. 46, S. 399-407.
x(Aitkin, M., Anderson, D., Hinde, J.) (1981), Statistical Modelling of Data on Teaching Styles,
Journal of the Royal Statistical Society, Series A, Vol. 144, Part 4, S. 419-561.
i have tried to solve this with the sscanf-function:
sscanf($lit[$x],"Vol. %d", &$vol[$x]);
sscanf($lit[$x],"No. %d", &$no[$x]);
sscanf($lit[$x],"Series %s", &$ser);
sscanf($lit[$x],"S. %d-%d.", &$pagef[$x], &$paget[$x]);
list($author[$x], $year[$x], $title[$x], $journal[$x])=sscanf($lit[$x],"x(%[a-zA-Z., \{}])
(%d), %[^,], %[^,]");
unfortunately the variables vol, no, series, pagef and paget do not work. can anyone help, as i do
not understand what may be wrong?