• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Conversion of binary file to text file

 
Smitha Vallaru
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can anybody helpme to convert text file to binary file. I am not sure what the contents are. Probably it may be a characters and Numbers.

Any help is appreciated.


Thanks
Smitha
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Is the question how to convert a text file to a binary file, or how to convert a binary file to a text file?

Any text file is a binary file, which just happens to contain only text characters, so no conversion is necessary.

A binary file could be encoded to become a text file, e.g. using the base-64 encoding. A library like Jakarta Commons Codec can do this.

But somehow I think you're asking something different; what eaxctly are you trying to do?
 
Smitha Vallaru
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry it was Binary file to text file. Thanks for pointing it out.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what you mean by "binary" file. Where does it come from? What does it look like if you print it on the console?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic