From: Jeff E. <JEm...@lg...> - 2004-04-07 19:26:22
|
add parens to the calls to nextToken userName = strTok.nextToken() -----Original Message----- From: Tim Hay [mailto:hob...@ya...] Sent: Wednesday, April 07, 2004 11:59 AM To: Jyt...@li... Subject: [Jython-users] Jython script that reads and processes a CSV file. I am trying to write a script that reads a csv file then process the contents. Here is what I have so far. from java.util import StringTokenizer from java.io import * file = File("c:\users.cvs") fileReader = FileReader(file) bufReader = BufferedReader(fileReader) while (<more lines in file>): user = bufReader.readline() strTok = StringTokenizer(user, ",") userName = strTok.nextToken password = strTok.nextToken descr = strTok.nextToken fileReader.close() When I try to run it I get the following error: Traceback (innermost last): (no code object) at line 0 File "c:\jython-2.1\Lib\CreateUsers3.py", line 11 userName = strTok.nextToken ^ SyntaxError: invalid syntax What am I doing wrong... I have spent the last 2 days searching the internet for help, but am still lost. Thanks, Tim __________________________________ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |