Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^2: SpreadSheet::ParseExcel Failure to Match Question

by finhagen (Sexton)
on May 04, 2009 at 01:09 UTC ( #761635=note: print w/replies, xml ) Need Help??

in reply to Re: SpreadSheet::ParseExcel Failure to Match Question
in thread SpreadSheet::ParseExcel Failure to Match Question

Thanks for the advice. I liked your matching idea - which I thought was promising but unfortunately it didn't seem to work any better than the eq. I have a print out of the variables I use for validation and it shows me that my match isn't working:
DE: 1002179816 DEDATE: 2009-5-4 OP# 996115 SO# 63170867 0 LINE# 1 1 QTY: 2 2 MODEL: CX-4PDAE-FD 3 DESC: 4G DAE FIELD INSTALL 4 UNIT: EA 5 LIST PRICE: 11800 6 DISCOUNT: 0.000 7 SELL PRICE: 0000 8 REP FLOOR: 0000 9 DM FLOOR: 0000 10 COST: 0000 11 MARGIN: 0.0000 12 MAINTENANCE: 0000 13 COMMENT: Seattle CX3-20 Expansion (30x300 15K) 14 SERIAL# 0 15 BU: IT 16 UPGRADE? 0 17 DEAL# 0

#14 should be a serial number such as APM1233432445. #16 should be a 1. Looks like there is something a little more complicated a foot. Thanks!


Replies are listed 'Best First'.
Re^3: SpreadSheet::ParseExcel Failure to Match Question
by McDarren (Abbot) on May 04, 2009 at 01:36 UTC
    In that case, I would insert:
    print "==$sheet->{Cells}[$row][3]->{Val}==\n";
    in the appropriate place, so that you can see what the contents of that cell actually are.

    Darren :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://761635]
[Cosmic37]: now I have tried another blunder - can anyone explain why I am such a dunderhead?
[Cosmic37]: if ( $line =~ /$mydt/ ) { print $line; }
[Cosmic37]: I try to match successive date times stored in variable $mydt
[Cosmic37]: I guess it is searching for the string "$mydt"
[Corion]: Indeed cool, erix ;)
[Cosmic37]: rather than the value of $mydt which is a date time strong such as 2016-01-01 12:30:56
[Corion]: Cosmic37: No, but maybe $mydt doesn't contain what you think it does, or it contains characters that are special in a regular expression? Try if( $line =~ /\Q$mydt\E/) { ... for a literal match
[Cosmic37]: I mean string grrr
[Corion]: Maybe add an else branch in which you print what the values of $line and $mydt are?
[Cosmic37]: ah thank you I will try

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2017-06-29 17:00 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (673 votes). Check out past polls.