in reply to Re^3: Create CSV file from xlsx file
in thread Create CSV file from xlsx 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.

Replies are listed 'Best First'.
Re^5: Create CSV file from xlsx file
by marto (Cardinal) on Oct 24, 2013 at 13:53 UTC

    This is confusing, are:

    use Spreadsheet::Read; use Text::CSV_XS;

    and

    xlscat -S 1 -C 9-11,21 -c sample.xlsx >file1.csv

    Different scripts? Why do you have use Text::CSV_XS;? Regardless you need to stop trying things at random in the hope they'll work. It's a poor strategy.

    In order to perform the task you need to you do not need to write a script. Do the following steps, in order, don't do anything else:

    1. Install Spreadsheet::Read, from the command prompt:

    cpan Spreadsheet::Read

    It will ask if you want to install xlscat as well as other utilities:

    marto@shemp:~$ cpan Spreadsheet::Read Reading '/home/marto/.cpan/Metadata' Database was generated on Thu, 24 Oct 2013 07:53:02 GMT Running install for module 'Spreadsheet::Read' Running make for H/HM/HMBRAND/Spreadsheet-Read-0.49.tgz Checksum for /home/marto/.cpan/sources/authors/id/H/HM/HMBRAND/Spreads +heet-Read-0.49.tgz ok CPAN.pm: Building H/HM/HMBRAND/Spreadsheet-Read-0.49.tgz Do you want to install 'xlscat' (Convert Spreadsheet to plain text or +CSV) ? [y] y Do you want to install 'ss2tk' (Show a Spreadsheet in Perl/Tk) ? [y] +y Do you want to install 'xls2csv' (Wrapper around xlscat for easy XLS = +> CSV) ? [y] y Checking if your kit is complete... Looks good

    cpan should install any prerequisites required.

    2. run the commands Tux gave you here.

    If you're actually interested in learning how these things work I suggest you spend time reading and understanding the following:

      FYI I uploaded Spreadsheet::Read version 0.50 today which adds the command xlsgrep and supports column names like -C D,F-H,Y,AH. I just checked MetaCPAN, which already shows this new release.

      The documentation includes a new TOOLS section.

      I'm always open to improvement suggestions.


      Enjoy, Have FUN! H.Merijn
        thank you .. Again i installed Spreadsheet::Read as mentioned by you and mart. when i ran the command its giving the same error.
        error: 'xlscat' is not recognized as an internal or external command,operable + program or batch file.
        xlscat -S 1 -C 9-11,21 -c sample.xlsx >file1.csv