#!/usr/intel/pkgs/perl/5.14.1/bin/perl use Spreadsheet::WriteExcel; $num_files = @ARGV[0]; print "Help - Syntax: ./process_xyz.pl \n"; print " The output file is: xyz_stat.xls \n"; my $workbook = Spreadsheet::WriteExcel->new('xyz_stat.xls') or die $!; my $worksheet_chart = $workbook->add_worksheet('chart'); my $chart = $workbook->add_chart(type => 'line', embedded => 1); for ($k = 1; $k <= $num_files; $k++) { $stat_file[$k] = @ARGV[$k]; open (_file, "$stat_file[$k]") or die "cannot open $stat_file[$k]"; $frm_num = 0; $frm_start = 2; $frm_end = 3; $tmp_var = "sim_$k"; $worksheet[$k] = $workbook->add_worksheet($tmp_var); while ($line = <_file>) { @frame_stats = split(/,/,$line); my $col = 0; foreach $el(@frame_stats) { $worksheet[$k]->write($frm_num, $col, $el); $col ++; } $frm_num++; } } $chart->add_series( # categories => '=test1!$A$2:$A$10', values => '=sim_1!$B$2:$B$361', # values => '=sim_1!$A$2:$A$361', name => 'sim1', ); $chart->add_series( # categories => '=test1!$A$2:$A$10', values => '=sim_2!$CU$2:$CU$361', name => 'sim2', ); $worksheet_chart->insert_chart('E2', $chart, 15, 10);