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

Changing values field values *100

Expand Messages
  • joach@direct.ca
    I have one more request.... then I have to settle down to catch up on my reading in Perl. I have a file that reads as 20000903,1.25,2.25.1.75,2.25,21540 all of
    Message 1 of 1 , Sep 4, 2000
    View Source
    • 0 Attachment
      I have one more request.... then I have to settle down to catch up on my
      reading in Perl.

      I have a file that reads as 20000903,1.25,2.25.1.75,2.25,21540
      all of the values in fields 1,2,3,4 have to be multilpied by 100 or if
      you wish the decimal moves to the right two places....... the date does
      not change nor does field 5.........

      This is another thing I can't seem to find in books.....


      Tia

      John



      my $infile = shift;
      my $outfile = shift;

      open (IN, $infile) || die "can't open $infile: $!";
      open (OUT, ">$outfile")|| die "can't open $outfile: $!";

      while (<IN>) {
      chomp;
      #code goes here......

      }

      close (IN);
      close (OUT);

      __END__
    Your message has been successfully submitted and would be delivered to recipients shortly.