How can I read Excel files in Perl?

前端 未结 3 1008
野趣味
野趣味 2021-01-18 02:35

I am looking for some examples/advice on how to write a Perl script to read data from an excel file then use the data read in (as a string hopefully) and pass it to another

相关标签:
3条回答
  • 2021-01-18 02:56

    Check out the synopsis in these modules:

    • Spreadsheet::ParseExcel,
    • Spreadsheet::WriteExcel
    0 讨论(0)
  • 2021-01-18 03:04

    The Spreadsheet::ParseExcel module can read Excel files. The documentation includes examples how to use it.

    0 讨论(0)
  • 2021-01-18 03:18

    You can use Spreadsheet::Read which will delegate to the appropriate module to read spreadsheets in a variety of formats such as Excel, OpenOffice and CSV.

    On the other hand, given your problem description, I think you would be much better off using a standard configuration file format:

    #!/usr/bin/perl
    
    use Config::Std;
    
    read_config 'ftp.ini' => my %config;
    
    for my $file ( keys %config ) {
        print "File: '$file'\n";
        print "$_: ", $config{$file}->{$_}, "\n"
            for qw( site protocol remote_name);
    }
    

    ftp.ini:

    [c:\Documents and Settings\user\My Documents\this.txt]
    site = ftp.example.com
    protocol = ftp
    remote_name = that.txt
    
    0 讨论(0)
提交回复
热议问题