Memoize

BasicWerk   EC Support   Technique   Facebook  

20141117204916_ruby_trim_each_value_in_csv

ruby_trim_each_value_in_csv

 

 

trim_col
 
#! /usr/bin/ruby
# coding: utf-8
 
# csv の各カラムを全て trim(strip) して書き出す
require 'csv'
file = ARGV.shift
CSV.foreach(file, headers: false) do |row|
    puts CSV.generate_line(row.map{|col| col.strip})
end
 

 


© Shin Nakamura/BasicWerk 2014