Hi Monks, I am very happy to tell you that i got some work on perl,from the below code i can read the csv file, from this output
i need to generate the .doc file from each row of the CSV file. The standerd document template is below
[DOCUMENT] INPUT= FORMAT= DESCRIPTION= RECDATE= DELETEINPUT=NO NODE_ID=1 VOLUME_ID=1 [CBNTFLDR] CABINET= FOLDER= [USER_DEFINITIONS] Freq:Daily Application:

Each line of the CSV will have 8 columns like Report Name,Report desciption,Actual filename,Report format,Report execution frequency,cabinet,folder and Apllication name.I have to parse each line of the CSV for obtaining the reportname,Report format,Report description,cabinet,folder and application name from the CSV file and need to create a .doc file for each row of CSV and save with teh report name as in the above .doc template.

Below is the code which i have obtained from this site to read the CSV file
use strict; use warnings; use Text::CSV_XS; my $file = "C:\\Users\\..\\Desktop\\reportlist.csv"; open my $fh, "<", $file or die "$file: $!"; my $csv = Text::CSV_XS->new ({ binary => 1, # Allow special character. Always set this auto_diag => 1, # Report irregularities immediately }); while (my $row = $csv->getline ($fh)) { print "@$row\n"; } close $fh;
After running the above code it displayes the o/p as below
Report Name Report Description Actual Filename Report Format Report +Execution Frequency Cabinet Folder Application GACCNTS MIS report csv Monthly DBNLRP GACCOUNT IDMS IDEALSCT IDEALIncomingCreditTransfers NVSEPAORT.yyyymmddnn.01 txt Mont +hly DBNLNVRP IDEALSCT MINT OVRSTPRJ OVERSTAP Rejected Transactions SEPAORT.yyyymmddnn.01 txt Mon +thly DBNLRP OVRSTPRJ RANSYS NLACGLST AcceptGiroVolumeperAccount SEPAAGL.yyyymmdd.01 txt Monthly DB +NLRP NLACGRVL MERVA NLACGVLM AcceptGiroVolume SEPAAGV.yyyymmdd.01 txt Monthly DBNLRP NLACG +RLS FMS NVACGLST AcceptGiroVolumeperAccount NVSEPAAGL.yyyymmdd.01 txt Monthly +DBNLNVRP NVACGRVL FMSFIN NVACGVLM AcceptGiroVolume NVSEPAAGV.yyyymmdd.01 txt Monthly DBNLNVRP N +VACGRLS DBCORAL

I have to create the number of .doc file for each row of CSV data and need to save the each documnet as with first field as Report name.Monks please suggest me the way to accomplish this task,This will be an humble request .Monks thanks in advance.

In reply to How to generate the .doc file for each row from a csv file by perladdict

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.