extract the same format from existing excel file using " Spreadsheet::ParseExcel " module


 
Thread Tools Search this Thread
Top Forums Programming extract the same format from existing excel file using " Spreadsheet::ParseExcel " module
# 1  
Old 01-24-2012
extract the same format from existing excel file using " Spreadsheet::ParseExcel " module

HTML Code:
Hi ,
can any one tell me,"How to extract the same format from existing excel file to new excel file " using Spreadsheet::WriteExcel or Spreadsheet::ParseExcel module ???

Example_pgm:

Below program is used to read existing excel file..In this program "my $cell        = $_[4];" line is used to extract the data from existing excel file..program have to extracting data along with its own format.....Is there any methods available for that?_________________________________________________________

#!/usr/bin/perl -w

    use strict;
    use Spreadsheet::ParseExcel;

    my $parser = Spreadsheet::ParseExcel->new(
        CellHandler => \&cell_handler,
        NotSetCell  => 1
    );

    my $workbook = $parser->parse('file.xls');

    sub cell_handler {

        my $workbook    = $_[0];
        my $sheet_index = $_[1];
        my $row         = $_[2];
        my $col         = $_[3];
        my $cell        = $_[4];

        # Skip some worksheets and rows (inefficiently).
        return if $sheet_index >= 3;
        return if $row >= 10;

        # Do something with the formatted cell value
        print $cell->value(), "\n";

    }
______________________________________________________________
Thanks,SmilieSmilie
kavi
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX for Beginners Questions & Answers

Extract delta records using with "comm" and "sort" commands combination

Hi All, I have 2 pipe delimited files viz., file_old and file_new. I'm trying to compare these 2 files, and extract all the different rows between them into a new_file. comm -3 < sort file_old < sort file_new > new_file I am getting the below error: -ksh: sort: cannot open But if I do... (7 Replies)
Discussion started by: njny
7 Replies

3. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

4. AIX

How to make existing volume group "shared"?

We have a 2 node cluster in which only the primary actually mounts the shared VGs at any specific time. We recently added a volume group to the primary. * The disks in it are visible to both nodes, but the secondary does not know about the new VG. * The new VG is not a "shared volume group" *... (10 Replies)
Discussion started by: ridgetop01
10 Replies

5. Shell Programming and Scripting

Can't locate Spreadsheet/ParseExcel

Hi I can't seem to figure out why i keep getting this error. the Spreadsheet::PhaseExcel is installed on 3 servers and is working on only 2... the last one it is installed exactly the same way but I keep getting this error. This is whats odd. If i run this script as a normal user i get... (2 Replies)
Discussion started by: vpundit
2 Replies

6. Shell Programming and Scripting

problem with "merge_range" in Spreadsheet::WriteExcel" module

Any one having idea that,How to copy merged cell from existing excel file to new excel file? Note : Is there any bug in module(Spreadsheet::WriteExcel or Spreadsheet::ParseExcel) itself ? Thanks, kavi (0 Replies)
Discussion started by: kavi.mogu
0 Replies

7. Shell Programming and Scripting

error in "Spreadsheet/TieExcel.pm "

can any one tell me how to rectify the below error? :confused:Can't locate Spreadsheet/TieExcel.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) (4 Replies)
Discussion started by: kavi.mogu
4 Replies

8. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

9. Shell Programming and Scripting

Format output from the file to extract "date" section

Hello Team , I have to extract date section from the below file output. The output of the file is as shown below. I have to extract the "" this section from the above output of the file. can anyone please let me know how can we acheive this? (4 Replies)
Discussion started by: coolguyamy
4 Replies

10. Shell Programming and Scripting

how to include spreadsheet::ParseExcel in shell script

Please tell me that how can we include Spreadsheet::ParseExcel module in shell script (1 Reply)
Discussion started by: akash
1 Replies
Login or Register to Ask a Question