In my rails application, I need to upload some doc/xls files and parse its structure and get information. How can I get data from *.doc or *.xls in maybe xml format or anything else that I can read and parse?
Asked
Active
Viewed 1,173 times
0
-
1Take a look at the [Yomu](https://github.com/Erol/yomu) gem. – Nick Veys Nov 11 '13 at 19:44
-
@NickVeys Thanks. But how I can open dc file in xml? can you give some example? – itdxer Nov 11 '13 at 20:15
3 Answers
1
You can parse different types of spreadsheets using the Roo gem. It supports:
- OpenOffice
- Excel
- Google spreadsheets
- Excelx
- LibreOffice
- CSV
From my experience it has some issues with parsing .xls files, however parsing .xlsx files is good.
As for .doc files, you may try using msworddoc-extractor gem or try one of the solutions proposed here.

trushkevich
- 2,657
- 1
- 28
- 37
0
Have you seen the Nokogiri gem? http://nokogiri.org/
Very useful for xml parsing

grenierm5
- 186
- 4
- 14
-
it's good but not for my issue. I need easy way for parse xml structure for big files – itdxer Nov 11 '13 at 22:52
0
The spreadsheet gem is nice for excel and csv files. https://github.com/zdavatz/spreadsheet

aarti
- 2,815
- 1
- 23
- 31
-
I was use it and get this problem http://stackoverflow.com/questions/19915887/ruby-roo-loaderror-cannot-load-such-file-spreadsheet-note – itdxer Nov 11 '13 at 23:41