def select(*args)
lines = 0
result = []
filter = (args.size > 0)
extras = []
@order_by = [@order_by] unless @order_by.is_a?(Array)
@order_by.each { | k | extras << k unless args.member?(k) }
file = open(@_parent._filename, "r")
file.each_line {
| line |
lines += 1
next unless(lines > @_parent.skip)
line.chomp!
arr = _type_map(line.split(@_parent.split))
hash = Hash[*@_parent._cols.zip(arr).flatten!]
if(self._apply(hash))
if filter
a = []
args.each { |k| a << hash[k] }
extras.each { |k| a << hash[k] }
result << a
else
result << arr
end
end
}
file.close
return _post_process(result, extras)
end