added --bins option

batch
Jeff Yates 2020-10-24 11:13:43 -04:00
parent 89bb9cf027
commit e12c6af35e
1 changed files with 4 additions and 3 deletions

View File

@ -85,11 +85,13 @@ OptionParser.new do |opts|
opts.on("-t", "--type type", "Type of file. Must be \"iat\" or \"pn\"") do |type| opts.on("-t", "--type type", "Type of file. Must be \"iat\" or \"pn\"") do |type|
options[:type] = type options[:type] = type
end end
opts.on("-b", "--bin-file binfile", "Name of the bin file") do |binfile|
options[:binfile] = binfile
end
end.parse! end.parse!
csv = CSV.read(options[:binfile])
csv = CSV.read('./bins.csv')
text = File.read(options[:file]) text = File.read(options[:file])
text = strip_text(text, 'PLOVEINTAKE', 'PLOVECLOSING') if options[:type] == 'iat' text = strip_text(text, 'PLOVEINTAKE', 'PLOVECLOSING') if options[:type] == 'iat'
text = split_text(text, 'Narrative:', 'Signatures:') if options[:type] == 'pn' text = split_text(text, 'Narrative:', 'Signatures:') if options[:type] == 'pn'
@ -108,4 +110,3 @@ bins.each_key do |bin_number|
end end
write_output(output,outfile) write_output(output,outfile)
puts text