Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Excel To Tab Delimited using Spreadsheet::ParseExcel

by Anonymous Monk
on Feb 25, 2015 at 20:47 UTC ( [id://1117873]=note: print w/replies, xml ) Need Help??


in reply to Re: Excel To Tab Delimited using Spreadsheet::ParseExcel
in thread Excel To Tab Delimited using Spreadsheet::ParseExcel

How can I retain empty cells? My report starts on the 6th column. When I use this, it removes the empty cells. I would want to have 5 tabs representing the first 5 empty columns.
  • Comment on Re^2: Excel To Tab Delimited using Spreadsheet::ParseExcel

Replies are listed 'Best First'.
Re^3: Excel To Tab Delimited using Spreadsheet::ParseExcel
by graff (Chancellor) on Feb 26, 2015 at 04:04 UTC
    A similar script that I posted here a couple years prior to the one above preserves empty cells that occur to the left of non-empty cells. (It also handles unicode character content, in case that's relevant.) Here: xls2tsv
Re^3: Excel To Tab Delimited using Spreadsheet::ParseExcel
by Anonymous Monk on Feb 26, 2015 at 03:27 UTC
    use the option that is documented to stop doing that :) (hint, read the "f"riendly docs)
      I removed 3 lines from the script and it is working. The first 2 -
      $value =~ s/^\s+//; $value =~ s/\s+$//;
      , I understand, strips off spaces from beginning and end. The third line I removed
      $value = " " if $value ne "0" && !$value;
      , what does that do? I wanted to ensure I did not remove a line that 'should' be in there.
        $value = " " if $value ne "0" && !$value; what does that do?

        The code means: Set $value to " " if "$value" is something other than the string "0" (Equality Operators) and also $value is false (Truth and Falsehood).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-19 03:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found