Comments (6)
That's interesting and probably specific to caxlsx. Do you have an example xlsx file you can share, by chance?
from xsv.
Here is a minimal test case:
require 'caxlsx'
require 'xsv'
p = Axlsx::Package.new
p.workbook.add_worksheet(name: 'Sheet') do |sheet|
sheet.add_row [1]
end
workbook = Xsv::Workbook.open(p.to_stream)
workbook.sheets.each do |sheet|
sheet.each_row do |row|
p row.inspect
end
end
This results in the following:
$ bundle exec ruby test.rb
.bundle/ruby/3.0.0/gems/xsv-1.0.2/lib/xsv/helpers.rb:108:in `parse_number_format': undefined method `scan' for nil:NilClass (NoMethodError)
from .bundle/ruby/3.0.0/gems/xsv-1.0.2/lib/xsv/sheet_rows_handler.rb:104:in `format_cell'
from .bundle/ruby/3.0.0/gems/xsv-1.0.2/lib/xsv/sheet_rows_handler.rb:60:in `end_element'
from .bundle/ruby/3.0.0/gems/xsv-1.0.2/lib/xsv/sax_parser.rb:68:in `block in parse'
from .bundle/ruby/3.0.0/gems/xsv-1.0.2/lib/xsv/sax_parser.rb:19:in `loop'
from .bundle/ruby/3.0.0/gems/xsv-1.0.2/lib/xsv/sax_parser.rb:19:in `parse'
from .bundle/ruby/3.0.0/gems/xsv-1.0.2/lib/xsv/sheet.rb:64:in `each_row'
from test.rb:11:in `block in <main>'
from test.rb:10:in `each'
from test.rb:10:in `<main>'
If I run the same script with Xsv 1.0.1, I get:
$ bundle exec ruby test.rb
"[1]"
FWIW, the same generated document opens LibreOffice and Emacs doc-view-mode.
Here is the doc generated by caxlsx:
from xsv.
I suppose this is the relevant row?
<row r="1" ><c r="A1" s="0" t="n"><v>1</v></c></row>
from xsv.
Thank you for the examples, it seems indeed some #nil?
checks were lost in c653bb8.
Could you test with the master branch and see if that fixes it?
from xsv.
Could you test with the master branch and see if that fixes it?
Yup! All looks good here. Thanks for the very quick response and fix! 🎉
from xsv.
You're welcome! Released Xsv 1.0.3 with the fix
from xsv.
Related Issues (20)
- Xsv::Workbook.open does not accept Tempfile HOT 3
- #<NoMethodError: undefined method `get_input_stream' for nil:NilClass> HOT 2
- decimal records are not processed correctly HOT 2
- Parse empty file HOT 1
- issue parsing xlsx (formatting?) HOT 8
- test
- test
- Encoding::UndefinedConversionError when parsing non-ASCII character HOT 4
- NameError: uninitialized constant Xsv in Sidekiq Worker HOT 2
- hash mode as an argument or parse_headers! can return self HOT 1
- :symbolize_names option for hash mode HOT 5
- If PhoneticProperties data is included, NoMethodError (undefined method `+' for nil:NilClas) will be raised. HOT 3
- Enhance parsing by headers HOT 3
- "Encountered unknown column type d" HOT 1
- Decimal values with % HOT 1
- NoMethodError: undefined method `[]' for nil:NilClass HOT 5
- Wrongly parsed hash HOT 5
- Generic HTML character entities not supported
- Breakage on Excel files without cell column names HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xsv.