View Single Post
  #2 (permalink)  
Old March 21st, 2006, 07:29 PM
ciderpunx ciderpunx is offline
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

read it into a variable or array and reverse that. For example in perl:
#!/usr/bin/perl -w
use strict;

# first read text file
open IN,'test.txt';
my @lines = <IN>;
close IN;

# reverse the order of our array and loop through
for (reverse @lines) {
  # reverse the characters in the line
  # reverse expects a LIST so we split $_ first
  print reverse split //,$_ ;
}


--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
Reply With Quote