csv_combine¶ ↑
“csv_combile” combines and reads two or more CSV files.
How to use.¶ ↑
(1) Add your Gemfile.
gem "csv_combine"
(2) Read CSV.
reader = CsvCombine.open("file_a.csv","file_b.csv") reader.each do |csv| puts csv end ["Yui Hirasawa", "17", "guitar"] ["Mio Akiyama", "17", "base"] ["Ritsu Tainaka", "17", "dram"] ["Tsumugi Kotobuki", "17", "keyboard"] ["name", "age", "instrument"] ["Azusa Nakano", "16", "guitar"]
(3) Options
# Uniq lines. CsvCombine.open("file_a.csv","file_b.csv",:uniq => true) # skip headers CsvCombine.open("file_a.csv","file_b.csv",:skip_header_files => "file_b.csv")
Copyright¶ ↑
Copyright © 2012 Yamamoto Kazuhisa. See LICENSE.txt for further details.