Showing posts with label textmate. Show all posts
Showing posts with label textmate. Show all posts

Wednesday, December 16, 2009

CocoaTech's Path Finder - Versatile Encoding Helper

Path Finder Save as SJIS for ExcelCocoaTech's Path Finder tool is a versatile Finder replacement. One problem that you might have if you do any work with data, is importing CSV files that are in the UTF-8 format, and which contain multi-byte characters such as Japanese, into Excel.

To import a UTF-8 CSV into Excel, you need to re-save into a format that Excel will accept, because it ironically does not accept the quite-universal UTF-8. I tried opening my UTF-8 CSV with TextMate and Text Edit to do the re-save into a different encoding, but neither of those allow me to save to Shift JIS, which renders Japanese characters so Excel can import them properly.

I saw that Path Finder has a native Text Editor, and thought I would try it. Sure enough, it allows you to re-save a file in Shift JIS and with a TXT extension, which can then easily be imported into Excel, unmunged.

Thanks CocoaTech!

Friday, October 30, 2009

Textmate Regular Expression Search and Replace

I use and love the text editor Textmate, which has some powerful functions. One thing that it can help with is quickly editing text files, and for example today I used it for searching lines in a mail system's "aliases" file. I wanted to remove 50-odd lines with the word owner in them, so I used the Find command with Regular Expression checked.

The search string is:

^.*owner.*$

If you enter that string which means to find the lines with owner in them, check "Regular Expression," and leave a blank in the Replace box, Textmate will blank out the lines for you. Convenient!

Wednesday, June 11, 2008

TextMate Japanese Input Bundle

I use TextMate for text editing in OS X and love its clean interface and features, but the defaults do not allow Japanese input and choosing Fonts has been problematic. Never fear. Hetima san, the developer of SafariStand, released a bundle called CJKInput for TextMate to allow Japanese input, and has a font to boot. I searched a few times for this in English and Japanese, but for some reason never came across it despite its having been around for quite some time.

At any rate, you can download CJKInput, and unzip and copy the tmbundle file into:

~/Library/Application Support/TextMate/PlugIns/

Hetima's Font-Forged, Mono-Space Japanese font ForMateKonaVe.ttf is here, so you can install that in the normal way. Enable it in TextMate Preferences, and away you go. The font is an amalgam of a Japanese font and Bitstream Vera Sans Mono, so it looks good too.