Sha256: 1ee2027e498e2030fa44c3a9ba3636234ca2768093bce3d73655cf0626035979
Contents?: true
Size: 1.38 KB
Versions: 1
Compression:
Stored size: 1.38 KB
Contents
#Excel 97-2003 PlainTextExtractor.new { every :xls as "application/excel" aka "Microsoft Office Excel document" extract_content_with "xls2csv SOURCE | grep -i [a-z] | sed -e 's/\"//g' -e 's/,*$//' -e 's/,/ /g'" => :on_linux_and_mac_os, "some other command" => :on_windows which_should_for_example_extract 'Some text (should be indexed!)', :from => 'table.xls' } #Excel 2007 require 'zip/zip' PlainTextExtractor.new { every :xlsx as 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' aka "Microsoft Office 2007 Excel spreadsheet" extract_content_with {|source| Zip::ZipFile.open(source){|zipfile| text_cells=zipfile.read("xl/sharedStrings.xml").split(/</).grep(/^t/).collect{|l| l.sub(/^[^>]+>/,'') } sheet_names=zipfile.read("xl/workbook.xml").split(/</).grep(/^sheet /).collect{|l| l.scan(/name="([^"]*)"/) } (sheet_names+text_cells).join("\n") } } which_should_for_example_extract '<- this result should not be 100000!', :from => 'office2007-excel.xlsx' or_extract 'Sheet name should be indexed!!!', :from => 'office2007-excel.xlsx' } ## Microsoft Excel to text conversion: ## Program: xls2csv ## Version tested: 0.37 ## Installation: Ubuntu catdoc package ## Home page: http://www.winfield.demon.nl/ ## MS OOXML excel to text conversion: ## Ruby code written by Eric DUMINIL
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
picolena-0.2.2 | lib/picolena/templates/lib/plain_text_extractors/ms.excel.rb |