Convert Excel to CSV
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
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 trapor you’re getting this when you try to
make
/usr/bin/ld: Undefined symbols: _compress _uncompress collect2: ld returned 1 exit statusThen 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
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:
- Install Xcode
- 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 -yto make sure you’re running the latest.
- 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 - 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' sudo gem installprereqs for Collaboa: xhtmldiff, syntax, and whatever else you need (like sqlite3-ruby or mongrel, perhaps).
ri disambiguation page in TextMate
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
