Hi, I have written a program using StringTokenizer.It takes a string and breaks it into tokens.The argument for StringTokenizer is a String.And this if working fine. My question is .. I want to input a text file from command line and read the text file and after performing some operation output the results to a text file. I am new to java, can any body tell as to which methods/classes to use? If i use FileInputStream , i am getting the following error Incompatible type for constructor. Can't convert java.io.FileInputStream to java.lang.String. StringTokenizer st = new StringTokenizer(fromFile); can anyone tell me whats wrong?? thanks sagarika
StringTokenizer's constructors like Strings as arguments. To get some lines (Strings) use a FileReader feeding a BufferedReader and use the BufferReader's getLine method. From the lines you can make StringTokenizers which you can use to get tokens. Sorry I don't write the code for you, but do post what you write if you have problems. -Barry [ October 18, 2002: Message edited by: Barry Gaunt ]