Skip to content

Instantly share code, notes, and snippets.

@masaakif
Created May 14, 2012 12:34
Show Gist options
  • Select an option

  • Save masaakif/2693702 to your computer and use it in GitHub Desktop.

Select an option

Save masaakif/2693702 to your computer and use it in GitHub Desktop.
カンマ区切りのファイルを読み込み、UTF16LEのタブ区切りに変える。最初のフィールドはスキップ、空のフィールドはN/Aにする。
require 'uconv' #ここ動かない
File.open(ARGV[0]).each do |line|
vals = line.gsub(/,,/,',N/A,').gsub(/,,/,',N/A,').split(',')
puts Uconv.sjistou16(vals[1..-1].join("\t"))#ここも動かない
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment