Advertisement

02.25.2005 at 09:27AM PST, ID: 21329349
[x]
Attachment Details

How do I edit the parameters in this Perl script

Asked by chdit in Perl Programming Language

Tags: , ,

how do I edit parameters to this perl script........  here is the senario, I just took a job for an IT company, and the previous guy had written some perl scripts for the company that run various functions...  one of those functions is a perl script that reformats the name of some data in an excel sheet...  

(my boss knows I don't know perl)

so basically i need to edit his script to include these 3 - 4 parameters...

1.  Input .xls file path
2.  Output .xls file path
3.  Header Row  - Row number which contains the actual headers such as "borrow" or "buyer".  This is how the script knows which columns to split and fix the lowercase on.
4.  Name Split Flag  --  Optional, we pass a 1 if we need the Borrower/Buyer split into FirstName and LastName in separate columns.


Here is the snippet of code I think needs to be edited::

use strict;                  
use Spreadsheet::ParseExcel::SaveParser;
           
&mymain();
               
sub mymain {
     my($INPUT,$OUTPUT,$HEADER,$NAMESPLIT);
               
     $INPUT  = $ARGV[0];
     $OUTPUT = $ARGV[1];
     $HEADER = $ARGV[2] - 1;
     $NAMESPLIT = $ARGV[3];
           
     if ( ! -f $INPUT ) {
         die("Missing input file $INPUT\n");
     }
     elsif ( -f $OUTPUT ) {
         die("Output file $OUTPUT already exists\n");
     }
     elsif ( ! defined $HEADER ) {
         die("Missing required header row number\n");
     }                      
                       











Start Free Trial
[+][-]02.25.2005 at 09:41AM PST, ID: 13405150

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.25.2005 at 10:14AM PST, ID: 13405481

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.25.2005 at 10:38AM PST, ID: 13405724

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.25.2005 at 11:47AM PST, ID: 13406324

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.25.2005 at 12:10PM PST, ID: 13406492

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Tags: excel, header, row
Sign Up Now!
Solution Provided By: bounsy
Participating Experts: 1
Solution Grade: A
 
 
[+][-]02.25.2005 at 01:26PM PST, ID: 13407138

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32