MoodyDreams999 has asked for the wisdom of the Perl Monks concerning the following question:
I keep running into an uninitialized error that doesnt make sense to me, I should be writing the state in column 6, but I keep getting
Perl C- said that was okay, but I get "syntax error at Project1_6.pl line 37, near "$t[""
Used perl c- it runs, says syntax is okay I tried declaring $t in line 35, "$worksheet->write($rowCount1+1, $_, my $t[$_]);"Use of uninitialized value $t[6] in string eq at Project1_6.pl line 48 +, <FH> line 2551. Use of uninitialized value $t[6] in string eq at Project1_6.pl line 42 +, <FH> line 2552.
Perl C- said that was okay, but I get "syntax error at Project1_6.pl line 37, near "$t[""
use Excel::Writer::XLSX; use strict; use warnings; my $rowCount = 0; my $filename = "Output2022.xlsx"; my $workbook = Excel::Writer::XLSX->new( $filename ); open(FH, "<", "SRC185.xlsx" ) or die; my $worksheet = $workbook->add_worksheet('List'); $worksheet->write(0, 0, "source_id" ); $worksheet->write(0, 1, "first_name" ); $worksheet->write(0, 2, "middle" ); $worksheet->write(0, 3, "last_name" ); $worksheet->write(0, 4, "address1" ); $worksheet->write(0, 5, "city"); $worksheet->write(0, 6, "state"); $worksheet->write(0, 7, "postal_code"); $worksheet->write(0, 8, "phone_number"); $worksheet->write(0, 9, "address3"); $worksheet->write(0, 10,"province"); $worksheet->write(0, 11, "email"); my $rowCount1 = 0; my $t=0; my @z = 90005; while (<FH>){ chomp; my @t=(',',$_); if(defined($t[8])){ my $Count=0; $worksheet->write($rowCount1+1, $_, $t[$_]); $Count++; } elsif($t[6] eq "CA" && $t[7] eq !defined) { $worksheet->write($rowCount1+1, 7, $z[7]); } $rowCount1++; } $workbook->close(); close(FH);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Parsing error
by pryrt (Abbot) on Jan 30, 2023 at 19:15 UTC | |
by MoodyDreams999 (Beadle) on Jan 30, 2023 at 21:41 UTC | |
by pryrt (Abbot) on Jan 30, 2023 at 22:00 UTC | |
by MoodyDreams999 (Beadle) on Jan 31, 2023 at 15:34 UTC | |
Re: Parsing error
by tangent (Parson) on Jan 31, 2023 at 00:27 UTC | |
by Anonymous Monk on Jan 31, 2023 at 15:28 UTC | |
by MoodyDreams999 (Beadle) on Jan 31, 2023 at 15:30 UTC | |
Re: Parsing error
by Anonymous Monk on Jan 30, 2023 at 19:00 UTC | |
by Anonymous Monk on Jan 30, 2023 at 19:05 UTC | |
by Anonymous Monk on Jan 30, 2023 at 21:37 UTC | |
Re: Parsing error
by exilepanda (Friar) on Jan 31, 2023 at 02:13 UTC | |
by MoodyDreams999 (Beadle) on Jan 31, 2023 at 15:40 UTC | |
by kcott (Archbishop) on Jan 31, 2023 at 19:06 UTC | |
by exilepanda (Friar) on Feb 01, 2023 at 03:01 UTC | |
Re: Parsing error
by MoodyDreams999 (Beadle) on Jan 30, 2023 at 18:56 UTC |
Back to
Seekers of Perl Wisdom