Upgrade to Pro — share decks privately, control downloads, hide ads and more …

表参道.rb#1 Warbler

表参道.rb#1 Warbler

表参道.rb#1でRubyスクリプトをjarにできたりするWarblerについてLTしました

デモで使ったコードはこちら
https://github.com/ariarijp/omotesandorb-lt-warbler/commits?author=ariarijp

Takuya Arita

June 04, 2015
Tweet

More Decks by Takuya Arita

Other Decks in Programming

Transcript

  1. ίʔυྫ αϯϓϧ # coding: utf-8 require 'csv' # Ҿ਺ʹ౉͞Εͨ༣ศ൪߸CSV͔ΒɺදࢀಓΤϦΞͷॅॴΛߦͷΈநग़ͯ͠ɺUTF-8Ͱout.csvʹॻ͖ग़͢ File.open('out.csv',

    'w') do |out| File.foreach(ARGV[0]).each do |line| # ༣ศ൪߸CSV͸SJISͳͷͰUTF-8ʹม׵ line.encode!('UTF-8', 'Windows-31J') csv_arr = CSV.parse_line(line) # http://ja.wikipedia.org/wiki/%E8%A1%A8%E5%8F%82%E9%81%93_%28%E5%8E%9F%E5%AE%BF%29 if /ਆٶલ|[๺ೆ]੨ࢁ/ =~ csv_arr[8] out.write(line) end end end