Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Excel cvs file filter
- # usage : ruby cvs_filter.rb input.csv column_no word
- #
- require "csv"
- col_names = nil
- CSV.open(ARGV[0], 'r') do |row|
- unless col_names
- STDOUT << CSV.generate_line(row) + "\n"
- col_names = row
- end
- STDOUT << CSV.generate_line(row) + "\n" if row[ARGV[1].to_i].data.include?(ARGV[2])
- end
Add Comment
Please, Sign In to add comment