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:


In reply to Re^5: Create CSV file from xlsx file by marto
in thread Create CSV file from xlsx file by viji234

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.