s_vijey has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am a newbie to perl and here goes my need, i have a set of text files(with extension as .txt) i have to grep for a particular pattern from them and write them into an excel sheet. Eg. file1.txt has a text REQXXXX (XXXX - any 4 digit number) file2.txt has a text REQXXXX (XXXX - any 4 digit number) now i want an excel sheet to be generated as below column 1. coulmn2 file1.txt REQXXXX file2.txt REQXXXX if the file1.txt doesnt have the number, the respective cell of the excel sheet should be left blank. I came to know that we need to have some packages for writing into excel, please help me to download the package and instal the same so that i can implement the above requirement. vijey

Replies are listed 'Best First'.
Re: writing into a excel sheet using perl
by NetWallah (Canon) on Nov 28, 2012 at 06:43 UTC
    Welcome to the Monastery.

    To get started with your project, you should install the Spreadsheet::WriteExcel module.

    You can do that by running the following command at your command prompt:

    cpan -i Spreadsheet::WriteExcel
    Depending on your OS, and flavour and version of Perl, You may run into issues that will require more research, and other items (such as a version of 'make') to be installed.

                 "By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest."           -Confucius

Re: writing into a excel sheet using perl
by 2teez (Vicar) on Nov 28, 2012 at 08:33 UTC

    Hi s_vijey,
    You can also check Excel::Writer::XLSX. This module uses the same interface as the Spreadsheet::WriteExcel which produces excel files in binary XLS format. These modules can also be used on Win OS.
    To install these module you can do as NetWallah, mentioned above or you can do like so:

    perl -MCPAN -eshell # from your CLI # then cpan> install Excel::Writer::XLSX # to install

    If you tell me, I'll forget.
    If you show me, I'll remember.
    if you involve me, I'll understand.
    --- Author unknown to me
Re: writing into a excel sheet using perl
by Ratazong (Monsignor) on Nov 28, 2012 at 07:32 UTC
Re: writing into a excel sheet using perl
by Anonymous Monk on Nov 28, 2012 at 09:16 UTC
    Please post your code, then only we can help you WE don't provide spoon feeding.