Hey Jerry,
I have a one quick solution for you.
str = "\"q4171\",\"(08/11/03 23:30:48)\",\"\"";
@array = split(/,/,$str);
foreach (@array)
{
s/\"//g ;
}
HTH
Pinku
Jerry Preston wrote:
Hi!,
I am trying to breakdown this line:
"q4171","(08/11/03 23:30:48)",""
with ( @data ) = split /[,|\"]/
Hi!,
I am trying to breakdown this line:
"q4171","(08/11/03 23:30:48)",""
with ( @data ) = split /[,|\"]/;#"
but I get many parts of the array that are empty.
All I want is in between the "'s.
Thanks,
Jerry
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EM
hi Jerry,
On second thought, I have a better solution for you.
$str = "\"q4171\",\"(08/11/03 23:30:48)\",\"\"";
@array = $str =~ /"([^"]*)"/g;
HTH
Pinku
Jerry Preston wrote:
Hi!,
I am trying to breakdown this line:
"q4171","(08/11/03 23:30:48)",""
with ( @data ) = split /[,|\"]/;#"
but I ge
t: Tuesday, August 12, 2003 10:38 AM
To: [EMAIL PROTECTED]
Subject: looking for a better way...
Hi!,
I am trying to breakdown this line:
"q4171","(08/11/03 23:30:48)",""
with ( @data ) = split /[,|\"]/;#"
but I get many parts of the ar
On Aug 12, Jerry Preston said:
>I am trying to breakdown this line:
>
>"q4171","(08/11/03 23:30:48)",""
>
>with ( @data ) = split /[,|\"]/;#"
Either use the Text::CSV module from CPAN (or perhaps Text::CSV_XS), or
else use a regex like the following:
@fields = $str =~ m{ " [^"]* " | [^,]+ }xg
Jerry Preston wrote:
>
> Hi!
Hello,
> I am looking for way to reduce the following code, a better way, a perl
> way. Any ideas?
>
> while ( my ( $Site, $Description, $Part_Number, $Part_Serial_Number, $Qty,
> $RMA_Number, $Customer_Contac, $RMA_Date, $Part_Rec ) = $sth->fetchrow()) {
> # w
Look at the sprintf function. Please!
> # while ( $data ) = $sth->fetchrow()) {
> $l = length( $Site );
> if( $l != 5 ) {
> $s = substr( "", 0, 5 - $l );
> $Site .= $s;
> }
Does this do what you want?
$Site = sprintf '%-5s', $Site;
One liner:
C:\>perl -e"$S
Hi Jerry.
"Jerry Preston" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi!
>
> I am looking for way to reduce the following code, a better way, a
perl
> way. Any ideas?
I think you've been overlooked a little because your post looks
very much like a 'please do my work for me' p
Hi!
I am looking for way to reduce the following code, a better way, a perl
way. Any ideas?
while ( my ( $Site, $Description, $Part_Number, $Part_Serial_Number, $Qty,
$RMA_Number, $Customer_Contac, $RMA_Date, $Part_Rec ) = $sth->fetchrow()) {
# while ( $data ) = $sth->fetchrow()) {
$l =