Created
December 2, 2015 02:16
-
-
Save violetyk/f6bddb9019c7e4c29160 to your computer and use it in GitHub Desktop.
CSVからURLを抽出してCSVファイルに書き出すスクリプト
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
# "12345", "long text...." | |
# "12346", "long text...." | |
require 'csv' | |
require 'uri' | |
CSV.open('url.csv', 'wb', force_quotes: true) do |output| | |
CSV.read('about.csv', encoding: 'UTF-8:UTF-8', header_converters: nil).map do |input| | |
tmp = [] | |
tmp << input[0] | |
tmp << URI.extract(input[1]) | |
output << tmp.flatten | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment