Index | index by Group | index by Distribution | index by Vendor | index by creation date | index by Name | Mirrors | Help | Search |
Name: perl-Spreadsheet-ReadSXC | Distribution: openSUSE Tumbleweed |
Version: 0.380.0 | Vendor: openSUSE |
Release: 2.2 | Build date: Sat Mar 9 00:04:31 2024 |
Group: Unspecified | Build host: reproducible |
Size: 83316 | Source RPM: perl-Spreadsheet-ReadSXC-0.380.0-2.2.src.rpm |
Packager: https://bugs.opensuse.org | |
Url: https://metacpan.org/release/Spreadsheet-ReadSXC | |
Summary: Extract OpenOffice 1.x spreadsheet data |
Spreadsheet::ReadSXC extracts data from OpenOffice 1.x spreadsheet files (.sxc). It exports the function read_sxc() which takes a filename and an optional reference to a hash of options as arguments and returns a reference to a hash of references to two-dimensional arrays. The hash keys correspond to the names of worksheets in the OpenOffice workbook. The two-dimensional arrays correspond to rows and cells in the respective spreadsheets. If you don't like this because the order of sheets is not preserved in a hash, read on. The 'OrderBySheet' option provides an array of hashes instead. If you prefer to unpack the .sxc file yourself, you can use the function read_xml_file() instead and pass the path to content.xml as an argument. Or you can extract the XML string from content.xml and pass the string to the function read_xml_string(). Both functions also take a reference to a hash of options as an optional second argument. Spreadsheet::ReadSXC uses XML::Twig to parse the XML contained in .sxc files. Only the contents of text:p elements are returned, not the actual values of table:value attributes. For example, a cell might have a table:value-type attribute of "currency", a table:value attribute of "-1500.99" and a table:currency attribute of "USD". The text:p element would contain "-$1,500.99". This is the string which is returned by the read_sxc() function, not the value of -1500.99. Spreadsheet::ReadSXC was written with data import into an SQL database in mind. Therefore empty spreadsheet cells correspond to undef values in array rows. The example code above shows how to replace undef values with empty strings. If the .sxc file contains an empty spreadsheet its hash element will point to an empty array (unless you use the 'NoTruncate' option in which case it will point to an array of an array containing one undefined element). OpenOffice uses UTF-8 encoding. It depends on your environment how the data returned by the XML Parser is best handled: use Unicode::String qw(latin1 utf8); $unicode_string = utf8($$workbook_ref{"Sheet1"}[0][0])->as_string; $latin1_string = utf8($$workbook_ref{"Sheet1"}[0][0])->latin1; Of course there are other modules than Unicode::String on CPAN that handle conversion between encodings. It's your choice. Table rows in .sxc files may have a "table:number-rows-repeated" attribute, which is often used for consecutive empty rows. When you format whole rows and/or columns in OpenOffice, it sets the numbers of rows in a worksheet to 32,000 and the number of columns to 256, even if only a few lower-numbered rows and cells actually contain data. Spreadsheet::ReadSXC truncates such sheets so that there are no empty rows after the last row containing data and no empty columns after the last column containing data (unless you use the 'NoTruncate' option). Still it is perfectly legal for an .sxc file to apply the "table:number-rows-repeated" attribute to rows that actually contain data (although I have only been able to produce such files manually, not through OpenOffice itself). To save on memory usage in these cases, Spreadsheet::ReadSXC does not copy rows by value, but by reference (remember that multi-dimensional arrays in Perl are really arrays of references to arrays). Therefore, if you change a value in one row, it is possible that you find the corresponding value in the next row changed, too: $$workbook_ref{"Sheet1"}[0][0] = 'new string'; print $$workbook_ref{"Sheet1"}[1][0]; As of version 0.20 the references returned by read_sxc() et al. remain valid after subsequent calls to the same function. In earlier versions, calling read_sxc() with a different file as the argument would change the data referenced by the original return value, so you had to derefence it before making another call. Thanks to H. Merijn Brand for fixing this.
Artistic-1.0 OR GPL-1.0-or-later
* Fri Mar 08 2024 Tina Müller <tina.mueller@suse.com> - Fix disabling of __perllib_provides * Fri Aug 11 2023 Tina Müller <tina.mueller@suse.com> - Update remove_filter_signatures.diff * Sat Jul 22 2023 Tina Müller <timueller+perl@suse.de> - updated to 0.38 see /usr/share/doc/packages/perl-Spreadsheet-ReadSXC/Changes 0.38 2023-07-21 * Various test suite updates, no code changes, no need to upgrade * Mon Nov 22 2021 Tina Müller <tina.mueller@suse.com> - Update patch remove_filter_signatures.diff * Mon Nov 22 2021 Tina Müller <timueller+perl@suse.de> - updated to 0.37 see /usr/share/doc/packages/perl-Spreadsheet-ReadSXC/Changes 0.37 2021-11-21 * Really require XML::Twig 3.50, since that adds the no_xxe option 0.36 2021-11-21 * Require XML::Twig 3.50, since that adds the no_xxe option * Wed Oct 20 2021 Tina Müller <tina.mueller@suse.com> - Update remove_filter_signatures.diff * Fri Sep 10 2021 Tina Müller <timueller+perl@suse.de> - updated to 0.35 see /usr/share/doc/packages/perl-Spreadsheet-ReadSXC/Changes 0.35 2021-09-08 * Fix memory leak in the XML parser callbacks Reported as GH #8 with a test case, thanks to troost-c! * Fri Mar 12 2021 Tina Müller <tina.mueller@suse.com> - Update patch remove_filter_signatures.diff * Thu Mar 11 2021 Tina Müller <timueller+perl@suse.de> - updated to 0.34 see /usr/share/doc/packages/perl-Spreadsheet-ReadSXC/Changes 0.34 2021-03-10 * Fix OrderBySheet option in Spreadsheet::ReadSXC, thanks to Kuerbis! * Fri Jan 08 2021 Dirk Stoecker <opensuse@dstoecker.de> - updated to 0.33 see /usr/share/doc/packages/perl-Spreadsheet-ReadSXC/Changes 0.33 2020-12-28 * Read style attributes immediately from Twig. This increases memory usage but removes problems when we recycle the Twig object for parsing another file * Custom styles are now better supported and don't crash the module immediately (issue GH #5 , reported with test file by mario-minati) * Point bug tracker meta data to Github
/usr/lib/perl5/vendor_perl/5.40.0/Spreadsheet /usr/lib/perl5/vendor_perl/5.40.0/Spreadsheet/ParseODS /usr/lib/perl5/vendor_perl/5.40.0/Spreadsheet/ParseODS.pm /usr/lib/perl5/vendor_perl/5.40.0/Spreadsheet/ParseODS/Cell.pm /usr/lib/perl5/vendor_perl/5.40.0/Spreadsheet/ParseODS/Settings.pm /usr/lib/perl5/vendor_perl/5.40.0/Spreadsheet/ParseODS/Styles.pm /usr/lib/perl5/vendor_perl/5.40.0/Spreadsheet/ParseODS/Workbook.pm /usr/lib/perl5/vendor_perl/5.40.0/Spreadsheet/ParseODS/Worksheet.pm /usr/lib/perl5/vendor_perl/5.40.0/Spreadsheet/ReadSXC.pm /usr/lib/perl5/vendor_perl/5.40.0/Spreadsheet/Todo.pod /usr/share/doc/packages/perl-Spreadsheet-ReadSXC /usr/share/doc/packages/perl-Spreadsheet-ReadSXC/Changes /usr/share/doc/packages/perl-Spreadsheet-ReadSXC/README /usr/share/licenses/perl-Spreadsheet-ReadSXC /usr/share/licenses/perl-Spreadsheet-ReadSXC/LICENSE /usr/share/man/man3/Spreadsheet::ParseODS.3pm.gz /usr/share/man/man3/Spreadsheet::ParseODS::Cell.3pm.gz /usr/share/man/man3/Spreadsheet::ParseODS::Settings.3pm.gz /usr/share/man/man3/Spreadsheet::ParseODS::Styles.3pm.gz /usr/share/man/man3/Spreadsheet::ParseODS::Workbook.3pm.gz /usr/share/man/man3/Spreadsheet::ParseODS::Worksheet.3pm.gz /usr/share/man/man3/Spreadsheet::ReadSXC.3pm.gz /usr/share/man/man3/Spreadsheet::Todo.3pm.gz
Generated by rpm2html 1.8.1
Fabrice Bellet, Tue Nov 19 23:55:21 2024