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 Java 8 in Action this week in the Java 8 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: 1973
    
    7

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to reverse the contents of a text file
 
Similar Threads
calling a button from utility file
String reversal program
Reading a file in reverse order
Radix Sort
Java: Convert a binary file to "text" and back again.