Hi,
I've checked the archives and numerous help pages and Java in a Nutshell by
Mr. D. Flanagan, could somebody please answer the following question:
I've used the following code to tokenize the input from a file, however on
of the entries has a space which should be split i.e. "Fred Jones" is
currently read as "Fred" and "Jones", furthermore, the entrie are delimited
by "," (COMMA) and EOL. It appears that I need to use wordChar() and
whitespaceChar() respectively but I'm not sure how, mainly because of the
unicode to int conversion required!
Please help!
StreamTokenizer tokenizer = new StreamTokenizer(in);
int type;
while ((type = tokenizer.nextToken()) != StreamTokenizer.TT_EOF)
{
switch (type)
{
case StreamTokenizer.TT_NUMBER:
// out.println("<>Number: " + tokenizer.nval);
break;
case StreamTokenizer.TT_WORD:
out.println(" <option>" + tokenizer.sval);
break;
}
}
out.println("</form>");
Chris J.
xt39096
e-mail:- jenkins, christopher
The Royal Bank of Scotland plc is registered in Scotland No 90312. Registered Office:
36 St Andrew Square, Edinburgh EH2 2YB.
The Royal Bank of Scotland plc is regulated by IMRO, SFA and Personal Investment
Authority.
This e-mail message is confidential and for use by the addressee only. If the message
is received by anyone other than the addressee, please return the message to the
sender by replying to it and then delete the message from your computer.
'Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not
accept responsibility for changes made to this message after it was sent.'
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html