まず、ソフトをインストール。
Java SDK 1.5.0_09インストール。
ActivePerl ver 5.8.8インストール。
Eclipse 3.2ンストール。
まずeclipseのHelpメニューの、”Software Updates”−”Find and Install”を選びます。
続いて、”Add Update Site”を押し、URLに”http://e-p-i-c.sf.net/updates”を入力してください。(名前はEPICなど)
そして、先ほど入れた名前(EPICなど)を選ぶと、EPICのインストールができます。
eclipseを再起動すると、無事エディタが使えるようになります。
■SQLiteデータインポート
・住所録zipdata.db作成する。
http://www.post.japanpost.jp/zipcode/download.html
・上記から住所データを取得。そのデータから、「"」を削除、文字コードを"Shift_JIS"から"UTF8"へ変換。
・テーブル・インデックスを作成
[CreateTable.sql]
create table zipdata (
code text not null,
old_zip text not null,
new_zip text not null,
pref_kana text not null,
city_kana text not null,
town_kana text not null,
pref text not null,
city text not null,
town text not null,
is_one_town integer not null,
is_aza integer not null,
is_area integer not null,
is_two_town integer not null,
is_update integer not null,
is_reason integer not null
);
[CreateIndex.sql]
create index old_zip_idx on zipdata(old_zip);
create index new_zip_idx on zipdata(new_zip);
create index code_idx on zipdata(code);
・SQLiteから[CreateTable.sql]、[CreateIndex.sql]を流す。
>sqlite3 zipdata.db < CreateTable.sql
>sqlite3 zipdata.db < CreateIndex.sql
・データをインポートする。
>sqlite3 -separator , zipdata.db ".import KEN_ALL.csv zipdata"
・SQLite Database Browserよりデータを確認。
> select * from zipdata where pref = "北海道" and city="札幌市中央区";
・データ作成OK。