From: Tim H. <hob...@ya...> - 2004-04-07 17:59:02
|
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/ |