Posted on June 9th, 2010
The following Applescript will convert a folder you select from Excel files to Excel XML files (XLS to XLSX). You must have an Excel version installed that supports XLSX obviously.
set theFolder to choose folder with prompt "Choose the folder that contains your Excel files"
tell application "Finder" to set theFiles to (files of theFolder)
set fileCount to count theFiles
repeat with i from 1 to fileCount
set fName to text 1 thru -5 of ((name of item i of theFiles) as text)
if ((name of item i of theFiles) as text) ends with ".xls" then
set tName to (theFolder as text) & fName & ".xlsx"
tell application "Microsoft Excel"
activate
open (item i of theFiles) as text
tell active workbook
save workbook as filename tName file format Excel XML file format with overwrite
end tell
close active workbook without saving
end tell
end if
end repeat
Posted on February 23rd, 2010
I recently received some data in the Advantage Database Server file format (.adt). In the past I have worked with DBF, Access, and .xls. I was able to find some way to retrieve data from these formats using open source software. The open source solutions were much easier to work with, usually not requiring any sort of driver installation, etc.
I searched thoroughly for an easy way to retrieve information from this set of .ADT files I was dealing with. Sybase provides tools to work with the data, but all of them require using their software or drivers developed by them. I would have settled for this if it wasn’t such a hassle to figure out how to use them. I asked the question on Stackoverflow.com and got an answer from one of the employee’s of Sybase. While helpful, the suggested Perl driver was one of the things I was avoiding. I did attempt it and after a little hassle, moved on to creating a simpler solution.
(more…)
Posted on June 13th, 2009
Some of the data I’ve been dealing with lately is in Microsoft Access databases (.mdb files). I’ve been surprised with the lack of support for manipulating these files outside of Access. There are a couple solutions, but nothing satisfied me needs. The worst data set came to me in a few hundred different .mdb files. It looked like the person that exported the database exported a copy of the database for each unique facility. So each facility had a file, but the schema for each file was exactly the same. It was apparent that in order to do any sort of complex queries on the data, the files would have to be combined. I was recommended a tool called mdbtools by somebody at a local Ruby meetup. I ended up using this along with Ruby inside of a Rake task to convert all my .mdb files into a single MySQL database. (more…)
Posted on June 7th, 2009
The content of my main web application, Myhealthcaresource, will contain more than 15000 detailed financial reports for nursing facilities at its future peak. Each of these reports contains textual information as well as monetary values. It might list administrator names, employee names/salaries, owners, products or services purchased. I wanted to have all of this information searchable on Google, without Google caching the page. I also wanted to let users who came from Google as a result of searching for this information see it without having to log in, but only the page that they found through Google search. (more…)
Posted on January 4th, 2009
Most people have had some experience with ruby’s built in #uniq method for Arrays. Internally, this method finds the unique items in the array by creating a hash internally, and this internal comparison is done with the #eql? method. If an item in the array is a Hash, then #eql? simply uses the object_id, generated by the #hash method, to determine whether it is equal to another object in the array. There are many solutions online each with s light variations and goals. I found myself in need of a uniq method for an array containing items in an arbitrarily deep nested structure (ie many sub-hashes and arrays). (more…)