Loading ...
Sorry, an error occurred while loading the content.

Help Reversing Data

Expand Messages
  • joach@direct.ca
    Well I am getting better but still not there yet. What I am trying to do is reverse the Data..... and add a Header......Reverses just fine..... and adds the
    Message 1 of 1 , Sep 4, 2000
    • 0 Attachment
      Well I am getting better but still not there yet. What I am trying to
      do is reverse the Data..... and add a Header......Reverses just
      fine..... and adds the Header. What I need is a line feed added behind
      the header so that the data does not start at the end of the
      Header...... I would like it to start the data the line after the
      Header.

      TIA

      John
      -------------------------------------------------

      #!/usr/bin/perl -w
      use strict;

      my $infile = shift;
      my $outfile = shift;
      my $header='"My Header"';
      print "Reversing date sequence\n";

      open (IN,$infile) || die "Could not open $infile $!";
      open (OUT, ">$outfile")|| die "can't open $outfile: $!";
      my @data= (<IN>);

      push @data,$header;

      @data = reverse @data;

      print OUT @data;
      close IN;
      close OUT;
      __End__
      ----------------------
    Your message has been successfully submitted and would be delivered to recipients shortly.