Sha256: c01adfbf84d2122d202fb1728a14a700825a02f23150dab9b46ecf77cb1c07a7

Contents?: true

Size: 490 Bytes

Versions: 42

Compression:

Stored size: 490 Bytes

Contents

#!/usr/bin/env ruby
require 'csv'
# $stderr.puts "#{__FILE__}:#{__LINE__}"

test_proc = eval "lambda {|row| #{ARGV.shift}}"

input = CSV.new(ARGF, :headers => true, :return_headers => true, :converters => :numeric)
output = CSV.new($stdout, :headers => true, :write_headers => true)

input.each.with_index do |row, index|
  # $stderr.puts "#{index}: >>#{row.to_s.chomp}<<"
  if row.header_row?
    output << row
    next
  end

  if test_proc.call(row)
    output << row
    next
  end
end

Version data entries

42 entries across 39 versions & 1 rubygems

Version Path
advance-0.4.11 bin/csv_select.rb
advance-0.4.10 bin/csv_select.rb
advance-0.4.8 bin/csv_select.rb
advance-0.4.7 bin/csv_select.rb
advance-0.4.6 bin/csv_select.rb
advance-0.4.5 bin/csv_select.rb
advance-0.4.4 bin/csv_select.rb
advance-0.4.3 bin/csv_select.rb
advance-0.4.2 bin/csv_select.rb
advance-0.4.1 bin/csv_select.rb
advance-0.3.18 bin/csv_select.rb
advance-0.3.16 bin/csv_select.rb
advance-0.3.15 bin/csv_select.rb
advance-0.3.14 bin/csv_select.rb
advance-0.3.13 bin/csv_select.rb
advance-0.3.12 bin/csv_select.rb
advance-0.3.11 bin/csv_select.rb
advance-0.3.10 bin/csv_select.rb
advance-0.3.9 bin/csv_select.rb
advance-0.3.8 bin/csv_select.rb