
sreenivas
New User
Apr 22, 2014, 5:38 AM
Post #1 of 5
(3170 views)
|
Formmatted output to a file
|
Can't Post
|
|
Hi, I am generating the report using perl report, where am writing the report on to a file. My file having 2 header fields having the lenght 100 and 2000 respectively. I could able genearate the report in the following format Filed1 Filed2 Filed1data Filed2data But I wanted to genearte in below format PAGE:1 Filed1 Filed2 -------------------------- ------------------------------- Filed1data Filed2data My code is: my $errorFile = "error.txt"; open my $outputErrorFile, '>>', $errorFile; print {$outputErrorFile} sprintf("%-100s%-2000s\n", "Filed1 ", "Filed2"); print {$outputErrorFile} sprintf("%-100s%2000s\n", "Invalid Record length", "some dynamic data goes here"); Please let me know how can I add dashed line under head and page nos and no.of records in each page. Thanks in advance
(This post was edited by sreenivas on Apr 22, 2014, 5:51 AM)
|