File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing a file

 
Olivier Legat
Ranch Hand
Posts: 176
Chrome Mac Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
1001
HP7
23
100
200

...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
Posts: 959
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use PrintWriter with its println() method to do that.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic