| Author |
Writing to an output file
|
c york
Greenhorn
Joined: Mar 16, 2006
Posts: 27
|
|
I am using the API FileWriter. - FileWriter outputFile = new FileWriter("Output.txt"); I have fields that I had broken up using the StringTokenizer method and I am not sure how to use the out.write("string") to get the fields in the output file. --------------------------------------------------------------------------------
|
 |
Greg Charles
Bartender
Joined: Oct 01, 2001
Posts: 2539
|
|
You write strings just exactly like that, except you've changed the name of the variable from outputFile to just out. That part won't work. One warning though: the FileWriter will create Unicode text files. If you want regular text files (single byte characters), you should use a FileOutputStream instead. The drawback is that any non-ASCII charcters you may be using will have to be encoded and the specifics of encoding can get a little tricky.
|
 |
 |
|
|
subject: Writing to an output file
|
|
|