By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,670 Members | 1,554 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,670 IT Pros & Developers. It's quick & easy.

Shifting columns in excel using perl

P: 1
Hi,
I am using perl. I have generated my 2d array datas using formy loop from A4 to D4. I want that datas from N4 to T4.


#!usr/local/bin/perl
print("Enter the no of corners:");
$corners=<STDIN>;

use Spreadsheet::WriteExcel;

my $workbook = Spreadsheet::WriteExcel->new( 'newproj.xls' );
my $worksheet = $workbook->add_worksheet();
my $format = $workbook->add_format();
$format->set_bold();

@array = ( ["","","","","","","",""] , ["","","","","","","",""] , ["","","","","","","",""] , [1,2,3,4,5,6,7] ,[2,4,6,8,10,12,14],[3,6,9,12,15,18,21] );

for my $i(0 .. $corners)
{
for my $j(0 .. 5)
{
$worksheet->write($j, $i , $array[$j][$i])
}
}

$workbook->close();
Feb 6 '17 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.