bazz
06-08-2008, 12:12 AM
Hi,
Having uploaded a csv file to one table, I am moving various parts of it to others as part of the normalisation process.
I need to remove some '_' and to capitalise each word in the array returned.
The following code works until I add the regex's as highlighted. Can the regex not be used here or have I forgotten something else.
while (my @fields = $sth->fetchrow_array) {
#print qq( <p>fields = @fields</p> );
# push (@full_list, @fields);
@fields =~ s/_/ /g;
@fields =~ s/(\w+)/ucfirst($1)/eg;
my $in = $dbhconnect->prepare ("INSERT into tbl_address
(address_id,
customer_id,
name_number,
address_1,
address_2,
address_3,
townland,
main_town,
county,
country)
values ('', ?, ?, ?, ?, ?, ?, ?, ?, ? )
") or die "prepare statement failed: $DBI::errstr\n";
bazz
Having uploaded a csv file to one table, I am moving various parts of it to others as part of the normalisation process.
I need to remove some '_' and to capitalise each word in the array returned.
The following code works until I add the regex's as highlighted. Can the regex not be used here or have I forgotten something else.
while (my @fields = $sth->fetchrow_array) {
#print qq( <p>fields = @fields</p> );
# push (@full_list, @fields);
@fields =~ s/_/ /g;
@fields =~ s/(\w+)/ucfirst($1)/eg;
my $in = $dbhconnect->prepare ("INSERT into tbl_address
(address_id,
customer_id,
name_number,
address_1,
address_2,
address_3,
townland,
main_town,
county,
country)
values ('', ?, ?, ?, ?, ?, ?, ?, ?, ? )
") or die "prepare statement failed: $DBI::errstr\n";
bazz