File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Writing a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Writing a file" Watch "Writing a file" New topic

Writing a file

Olivier Legat
Ranch Hand

Joined: Nov 17, 2007
Posts: 176

Hello. I'm having trouble to write a file the way I want. I want a .txt file to be written by a program in exactly this way:

...but my program records this onto the file.
�HP7 d �

This is the code of my method

Note: I am using a Random Access File - raf

Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

You can use PrintWriter with its println() method to do that.

SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
I agree. Here's the link:
subject: Writing a file
It's not a secret anymore!