Created
June 14, 2012 03:10
-
-
Save zunda/2927831 to your computer and use it in GitHub Desktop.
カンマ区切りのファイルをパイプ区切りのファイルに変換する。データにパイプがあると変になるよ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# usage: ruby csv2psv.rb path-to.csv > path-to.psv | |
# | |
# Copyright 2012 (C) zunda <zunda at freeshell.org> | |
# | |
# Permission is granted for use, copying, modification, | |
# distribution, and distribution of modified versions of this | |
# work as long as the above copyright notice is included. | |
require 'csv' | |
CSV.foreach(ARGV.shift) do |row| | |
puts row.join('|') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment