5 ms·
Did it last week. Been tooling around with Ruby (MacRuby actually), and had a data processing task that required round tripping to Excel - CPAN to the rescue.
by zdw 16y ago
Did it last week. Been tooling around with Ruby (MacRuby actually), and had a data processing task that required round tripping to Excel - CPAN to the rescue.
Because of it's age, there's just a greater number of codebases out there that can do esoteric and unusual stuff - I tend to think that languages that share easy interop through a shared runtime (Cocoa/Macruby, Java/Scala/JRuby, etc.) might be the future of that concept.
- getsat 16y agoWhy didn't you install a gem for spreadsheet manipulation?
- zdw 16y agoEveryone involved is on a Mac, and the ruby code to control Excel is OLE based, thus Windows only. Also, the files are .xls, which doesn't have a writer method in ruby (that I'm aware of), although there is an .xlsx library. Perl's ParseExcel and WriteExcel worked great in this case, and easily handle edge cases like leading zeros on zipcodes, formatting directives, etc. As always YMMV.
- andrewcarpenter 16y agoI've used the Ruby spreadsheet gem with success. It's a bit old, but works ok. http://spreadsheet.rubyforge.org/ http://spreadsheet.rubyforge.org/
- getsat 16y agoI've used this extensively for generating spreadsheets, and it's pretty awesome.
- zdw 16y agoAh, a port of Perl's module... good to know. Makes you wonder how soon it'll be before languages that are out of favor but have great libraries written for them are mainly viewed as targets for mining ideas and techniques, like how the various open source kernel developers use each other's kernels as driver documentation.