LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 04-30-2013, 09:52 PM   #1
PoleStar
Member
 
Registered: Jul 2010
Posts: 120

Rep: Reputation: 1
( Excel::Writer::XLSX->new) question: how to open single sheet by name


Hello,

I went through cpan page of (Excel::Writer::XLSX)
It only say one method which is open document, and all the sheets will be read into
an array, then you loop array to do some thing with sheets.

In my case I only have one sheet, I did datadump on object


Code:
my $workbook = Excel::Writer::XLSX->new( 'B.xlsx' ) ;

print Dumper $workbook;
but did not get any thing I could use.
So how do address one sheet with out looping into array.
 
Old 05-01-2013, 04:06 AM   #2
normanlinux
Member
 
Registered: Apr 2013
Distribution: Arch and SuSE
Posts: 54

Rep: Reputation: Disabled
Please clarify. Are you trying to use Libreoffice to handle this document?

"It only say one method" to what does 'it' refer?
 
Old 05-01-2013, 05:39 AM   #3
jdkaye
Senior Member
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 4,848

Rep: Reputation: Disabled
xlsx is a Microsoft format for a spreadsheet. Are you trying to convert that to an .ods format, which is an opendocument format for a spreadsheet?
jdk
 
Old 05-01-2013, 06:21 AM   #4
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,438

Rep: Reputation: 103Reputation: 103
This perl module cannot be used to write to an existing excel file. It can create new files only.

Quote:
DESCRIPTION ^

The Excel::Writer::XLSX module can be used to create an Excel file in the 2007+ XLSX format.

The XLSX format is the Office Open XML (OOXML) format used by Excel 2007 and later.

Multiple worksheets can be added to a workbook and formatting can be applied to cells. Text, numbers, and formulas can be written to the cells.

This module cannot, as yet, be used to write to an existing Excel XLSX file.


use Excel::Writer::XLSX;

# Create a new Excel workbook
my $workbook = Excel::Writer::XLSX->new( 'perl.xlsx' );

# Add a worksheet
$worksheet = $workbook->add_worksheet();
If you use Spreadsheet::ParseExcel you usually loop through te worksheets with
something like
for my $worksheet ( $workbook->worksheets() ) {

}

my @sheets = $workbook->worksheets();
$sheets[0] will contain the first element.

So what's the problem with that?

Last edited by j-ray; 05-01-2013 at 06:27 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HOWTO transfer Hosts in excel sheet to file in LINUX? manalisharmabe Linux - Newbie 2 11-07-2011 02:18 PM
i want c program for fetching data from excel sheet rinu budhbhatti Programming 3 01-31-2011 09:23 AM
Want to import an excel sheet data from from a remote linux server envisage Programming 1 01-31-2008 02:08 PM
how to import MS-Excel sheet data using PHP dileepkk Programming 1 07-28-2004 03:23 PM


All times are GMT -5. The time now is 04:41 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration