# File lib/faster_csv.rb, line 1012
    def self.filter(*args)
      # parse options for input, output, or both
      in_options, out_options = Hash.new, {:row_sep => $INPUT_RECORD_SEPARATOR}
      if args.last.is_a? Hash
        args.pop.each do |key, value|
          case key.to_s
          when /\Ain(?:put)?_(.+)\Z/
            in_options[$1.to_sym] = value
          when /\Aout(?:put)?_(.+)\Z/
            out_options[$1.to_sym] = value
          else
            in_options[key]  = value
            out_options[key] = value
          end
        end
      end
      # build input and output wrappers
      input   = FasterCSV.new(args.shift || ARGF,    in_options)
      output  = FasterCSV.new(args.shift || $stdout, out_options)

      # read, yield, write
      input.each do |row|
        yield row
        output << row
      end
    end