From e12c6af35ea468545b524d65948a2c4794911214 Mon Sep 17 00:00:00 2001 From: Jeff Yates Date: Sat, 24 Oct 2020 11:13:43 -0400 Subject: [PATCH] added --bins option --- sorter.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sorter.rb b/sorter.rb index b339d52..5a9e05e 100755 --- a/sorter.rb +++ b/sorter.rb @@ -85,11 +85,13 @@ OptionParser.new do |opts| opts.on("-t", "--type type", "Type of file. Must be \"iat\" or \"pn\"") do |type| options[:type] = type end + opts.on("-b", "--bin-file binfile", "Name of the bin file") do |binfile| + options[:binfile] = binfile + end end.parse! - -csv = CSV.read('./bins.csv') +csv = CSV.read(options[:binfile]) text = File.read(options[:file]) text = strip_text(text, 'PLOVEINTAKE', 'PLOVECLOSING') if options[:type] == 'iat' text = split_text(text, 'Narrative:', 'Signatures:') if options[:type] == 'pn' @@ -108,4 +110,3 @@ bins.each_key do |bin_number| end write_output(output,outfile) -puts text