I am still new to this I tried to writing the following below
Just to let you know i am still a newbie.
Expand|Select|Wrap|Line Numbers
- #!/usr/bin/perl
- user warnings;
- use strict;
- use Fcntl;
- $OD = "filehandle";
- $filepath = "myorders.txt";
- my @line = open(OD, $FilePath) or die "file could not be opened";
- $line = <OD>;
- print $line;
- close OD;
- for $line (<OD>){
- $i = "1";
- $a = ($line);
- #This is how the line looks like####
- # Line 1 contains:#
- # D30002115964000080000200US NXLS000000014888320070110200701090000000000000005 - 00000000 20061345000000001USA 000000.05 NN 00000000 #
- # I am trying to get what is underlined#
- $info = 'substr($a 5 6 7 8 9 10 11 12)';
- print "$info";
- $quantity = 'substr($a 80 81)';
- print "$quantity"
- sysopen(HTML, 'myvalues.txt', O_RDWR|O_EXCL|O_CREAT, 0755);
- printf HTML "$info" "$quantity \n"
- close(HTML);
- $i++
- };