Sha256: e91f37ea97983f008fa4395cb32006cf3a51e601beba63fda20eb16a02b1feea

Contents?: true

Size: 505 Bytes

Versions: 3

Compression:

Stored size: 505 Bytes

Contents

# Open Document Spreadsheet to text conversion

require 'zip/zip'
PlainText.extract {
  from :ods
  as 'application/vnd.oasis.opendocument.spreadsheet'
  aka "Open Document Format for spreadsheet"
  with {|source|
    Zip::ZipFile.open(source){|zipfile|
      zipfile.read("content.xml").split(/</).grep(/^text:(p|span)/).collect{|l|
        l.sub(/^[^>]+>/,'')
      }.join("\n")
    }
  }
  which_should_for_example_extract 'Cessna F-172P G-BIDF, serial number 2045', :from => 'weight_and_balance.ods'
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
picolena-0.0.99 app_generators/picolena/templates/lib/filters/opendocument.spreadsheet.rb
picolena-0.1.0 lib/picolena/templates/lib/filters/opendocument.spreadsheet.rb
picolena-0.1.1 lib/picolena/templates/lib/filters/opendocument.spreadsheet.rb