Convert Excel to CSV

Posted by Jason Garber Sat, 23 Jun 2007 13:19:00 GMT

A little Applescript to batch convert xls files to csv:


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 & ".csv" 
        tell application "Microsoft Excel" 
            activate
            open (item i of theFiles) as text
            save fName in tName as CSV
            close active workbook without saving
        end tell
    end if
end repeat

Compiling ht://Check on OS X

Posted by Jason Garber Fri, 01 Jun 2007 18:56:00 GMT

In case you’re trying to configure ht://Check on OS X and running into
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
  Referenced from: /usr/local/htcheck/lib/htcheck/libhtmysql-1.2.4.dylib
  Expected in: flat namespace

dyld: Symbol not found: _mysql_init
  Referenced from: /usr/local/htcheck/lib/htcheck/libhtmysql-1.2.4.dylib
  Expected in: flat namespace

Trace/BPT trap
or you’re getting this when you try to make
/usr/bin/ld: Undefined symbols:
_compress
_uncompress
collect2: ld returned 1 exit status
Then compile like this:
export EXTRA_LIBS='-lz'
./configure --prefix=/usr/local/htcheck --with-mysql=/usr/local/mysql --enable-static --disable-shared
make
sudo make install
..and you’ll save yourself a few hours’ frustration.

Installing Ruby + Rails + SWIG + SVN on OS X from scratch

Posted by Jason Garber Fri, 25 Aug 2006 00:08:00 GMT

I just moved up from a PowerBook to a MacBook and had to rebuild my environment so I could work on Collaboa. For posterity’s sake, here’s what you have to do:

  1. Install Xcode
  2. Download Roll_Ruby_On_Rails.zip from http://sg.validcode.at/articles/2006/03/31/the-best-way-to-install-rails-on-os-x
    • Modify your ~/.bash_login as directed. Or .bash_profile or .bashrc or .profile or whatever you call yours.
    • Source that file
    • Run the script with sudo sh roll_ruby_on_rails.sh
    • Probably do a gem up -y to make sure you’re running the latest.
  3. Download and install swig (not really necessary for svn-ruby bindings, but is necessary for sqlite3 on OS X)
    $ ./configure --prefix=/usr/local
    $ make
    $ sudo make install
    $ swig -version # Verify it's installed and the correct version
  4. Download and install Subversion
    $ ./configure --prefix=/usr/local --with-openssl --with-ssl --with-zlib
    $ make
    $ sudo make install
    $ svn --version # Verify it's installed and the correct version
    $ make swig-rb
    $ sudo make install-swig-rb
    $ make check-swig-rb # Optional.  Expect errors for FS type 'bdb'
  5. sudo gem install prereqs for Collaboa: xhtmldiff, syntax, and whatever else you need (like sqlite3-ruby or mongrel, perhaps).

ri disambiguation page in TextMate

Posted by Jason Garber Mon, 19 Jun 2006 21:51:00 GMT

TextMate is a beautiful little application, but one tiny corner of it wasn’t working and I decided to track down a fix. When I looked for documentation (^H) on an ambiguous Ruby method name (like ‘sort’), the links in the disambiguation page didn’t work.

Allan, the developer, helped me out on his IRC channel. He said the path to ri isn’t in my PATH. He meant that it’s in my bash path, but for whatever reason, this path isn’t read for ri. He said I needed to put an entry in ~/.MacOSX/environment.plist. I copied and pasted from this page and now it works like a charm.

Older posts: 1 2