Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: SpreadSheet::ParseExcel Failure to Match Question

by McDarren (Abbot)
on May 03, 2009 at 23:36 UTC ( #761625=note: print w/ replies, xml ) Need Help??


in reply to SpreadSheet::ParseExcel Failure to Match Question

Could it be that $sheet->{Cells}[$row][3]->{Val} contains "non-printable" characters that prevent an exact match?

You could check this by inserting a print statement, or simply use =~ instead of eq, eg.

if ($sheet->{Cells}[$row][3]->{Val} =~ m/UPGRADE SOLUTION/) {$upgrade= +1} else {$upgrade=0};
Hope this helps,
Darren :)


Comment on Re: SpreadSheet::ParseExcel Failure to Match Question
Select or Download Code
Replies are listed 'Best First'.
Re^2: SpreadSheet::ParseExcel Failure to Match Question
by finhagen (Sexton) on May 04, 2009 at 01:09 UTC
    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!

    Hagen
      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.

      Cheers,
      Darren :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://761625]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (14)
As of 2015-07-31 12:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (277 votes), past polls