PERL es mejor que una Escoba :) jejejejeje
open(MYINPUTFILE, "; # read file into list
@lines = sort(@lines); # sort the list
my($line);
foreach $line (@lines) # loop thru list
{
#print "$line"; # print in sort order
$line =~ s/,/]/g;
#$line =~ s/]]/]/g;
#$line =~ s/]]/]/g;
#print $line;
my @campos2 = split(/]/,$line);
chomp $campos2[0];
$campos2[0] =~ s/'//g;
chomp $campos2[1];
chomp $campos2[2];
chomp $campos2[3];
chomp $campos2[4];
chomp $campos2[6];
chomp $campos2[7];
chomp $campos2[11];
chomp $campos2[17];
chomp $campos2[18];
$campos2[0] =~ s/\s+$//;
$campos2[1] =~ s/\s+$//;
$campos2[3] =~ s/\s+$//;
$campos2[2] =~ s/\s+$//;
$campos2[6] =~ s/\s+$//;
$campos2[7] =~ s/\s+$//;
$campos2[12] =~ s/\s+$//;
$campos2[17] =~ s/\s+$//;
$campos2[18] =~ s/\s+$//;
print "\n";
print "Codigo: $campos2[0]\n";
print "Nombre: $campos2[1]\n";
print "Telefono: $campos2[2]\n";
print "Documento: $campos2[6]\n";
printf ("Numero: %.0f \n", $campos2[7]);
print "Vence: $campos2[11]\n";
printf ("TOTAL: %.2f \n", $campos2[17]);
printf ("Dias: %.0f \n", $campos2[18]);
#;
}
close(MYINPUTFILE);
- bitfrost's blog
- Login to post comments
- 2376 reads
Comentarios recientes
8 years 27 weeks ago
8 years 51 weeks ago
8 years 51 weeks ago
8 years 51 weeks ago
10 years 14 weeks ago
11 years 22 weeks ago
11 years 22 weeks ago
11 years 23 weeks ago
12 years 18 weeks ago
12 years 26 weeks ago