LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 08:52 PM   #1
PoleStar
Member
 
Registered: Jul 2010
Posts: 231

Rep: Reputation: 2
( 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, 03:06 AM   #2
normanlinux
Member
 
Registered: Apr 2013
Location: S.E. England
Distribution: Arch
Posts: 161

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, 04:39 AM   #3
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

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, 05:21 AM   #4
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
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 05:27 AM.
 
  


Reply



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 01:18 PM
i want c program for fetching data from excel sheet rinu budhbhatti Programming 3 01-31-2011 08:23 AM
Want to import an excel sheet data from from a remote linux server envisage Programming 1 01-31-2008 01:08 PM
how to import MS-Excel sheet data using PHP dileepkk Programming 1 07-28-2004 02:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:07 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration