Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Convert XLSX to TSV and remove CRLF in cells

by MidLifeXis (Monsignor)
on Jun 16, 2015 at 12:37 UTC ( [id://1130597]=note: print w/replies, xml ) Need Help??


in reply to Convert XLSX to TSV and remove CRLF in cells

If I remember correctly, the spreadsheet reading modules load the data into memory by default. The data structure used to do this can be a fairly large hash, based on the options used. It appears that this particular module unzips the xlsx package into a temporary directory and then parses it into its own internal structure. Depending on the complexity of the formatting, parameters passed to the parser, amount of data in each row, and so on, this can be an expected behavior. If you are not in need of any of the formatting, you may want to try the ':just_the_data' flags from Spreadsheet::XLSX::Reader::LibXML, which (at least from my experience - and it may not be yours in this case) should speed things up significantly.

If you are getting this twice a month, how much time do you expect to shave off from the task per month, and is that time in an automated process critical? If you (not the machine, you) are spending the 2.5 hours on this task, let's run some numbers (based on xkcd://is it worth the time):

  • Shave off 2 hours per execution, 4 hours per month
  • You will be running this for the next 5 years
You can spend about 7 days to trim down the time you spend on this task.

If it is not your time being used, then you really should consider if this automation must run as fast as possible, or if it will be sufficient to spend machine and clock cycles to remove the manual process. Typically your time is worth much more than the computer's time.

Update: Also, profile the various parts of your application. Where is the hangup? Compilation, reading, converting the data, writing, memory allocation, disk I/O? Unless you know what is taking the most time, you are just throwing a handful of parts into the machine and hoping it fixes itself.

--MidLifeXis

  • Comment on Re: Convert XLSX to TSV and remove CRLF in cells

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-24 07:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found