aspose file tools*
The moose likes I/O and Streams and the fly likes how to reverse the contents of a text file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "how to reverse the contents of a text file" Watch "how to reverse the contents of a text file" New topic
Author

how to reverse the contents of a text file

aakash bose
Greenhorn

Joined: Jun 10, 2013
Posts: 4

hi guyz!! I want to read the characters from a text file and print each character in reverse order. e.g
if the file SAMPLE.txt is:
abc
def
ghi

my output should be
ihj
fed
cba


K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2505
    
    8

You may want to check the JavaRanch jr.jar javadoc Str class. http://www.javaranch.com/doc/com/javaranch/common/Str.html

Or other API that does string manipulation rather than writing your own.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5 OCPBCD5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to reverse the contents of a text file