lib/rbbt/util/R.rb in rbbt-util-5.5.68 vs lib/rbbt/util/R.rb in rbbt-util-5.6.0

- old
+ new

@@ -66,9 +66,15 @@ else raise "Type of object not known: #{ object.inspect }" end end + def self.tsv(file, options = {}) + options = Misc.add_defaults :header_hash => '', :sep => / +/, :type => :list, :key_field => 'ID' + key_field = Misc.process_options options, :key_field + clean = CMD.cmd('grep -v WARNING', :in => file, :pipe => true) + TSV.open(clean, options).tap{|tsv| tsv.key_field = key_field } + end end module TSV def R(script, open_options = {})