Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Create CSV file from xlsx file

by Tux (Monsignor)
on Oct 24, 2013 at 11:40 UTC ( #1059432=note: print w/ replies, xml ) Need Help??


in reply to Create CSV file from xlsx file

Why use Spreadsheet::WriteExcel and Spreadsheet::ParseExcel when you do not use them?

To generate reliable CSV data, use Text::CSV_XS or Text::CSV

As was suggested to you in the ChatterBox already was to use Spreadsheet::Read's xlscat for this task.

$ xlscat -S 1 -C 9-11,21 -c sample.xlsx >file1.csv $ xlscat -S 1 -C 12-19,21 -c sample.xlsx >file2.csv $ xlscat -S 2 -C 10-12,14 -c sample.xlsx >file3.csv

Enjoy, Have FUN! H.Merijn


Comment on Re: Create CSV file from xlsx file
Select or Download Code
Re^2: Create CSV file from xlsx file
by viji234 (Initiate) on Oct 24, 2013 at 11:53 UTC
    Hi Tux after running the script as u mention its giving error as syntax error at test.pl line 11, near "$ xlscat -S " Execution of test.pl aborted due to compilation errors.

      xlscat is a perl script (read the links given), have you simple added the lines Tux gave you to your existing script? If so don't. The examples given to you run from the command line, your script is not required.

        when i ran the command in cmd it gives error as 'xlscat' is not recognized as an internal or external command, operable program or batch file.
        When i ran this command in CMD it gives the below error 'xlscat' is not recognized as an internal or external command, operable program or batch file.
        Thank you :) In the xlscat script i removed the #!/pro/bin/perl and added the use Spreadsheet::Read,use Text::CSV_XS and ran the command . it creates the file1.csv file but no records are there in the file and it return the below error
        xlscat -S 1 -C 9-11,21 -c sample.xlsx >file1.csv
        error: 'xlscat' is not recognized as an internal or external command, operable program or batch file.
        Thank you marto:) In windows I am using strawberry-perl 5.18.1.1.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2014-10-22 05:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (113 votes), past polls