perladdict has asked for the wisdom of the Perl Monks concerning the following question:
[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 fileAfter running the above code it displayes the o/p as belowuse 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;
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.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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to generate the .doc file for each row from a csv file
by hdb (Monsignor) on Feb 23, 2014 at 10:09 UTC | |
by perladdict (Chaplain) on Feb 23, 2014 at 12:05 UTC | |
by hdb (Monsignor) on Feb 23, 2014 at 12:26 UTC |