To be honest, I don't know. We already use a script that is similar which was created by someone who knew Ruby much better than myself. I copied the .rb file and have modified & removed some of the unnecessary coding for this task. Though, this never occurred to me as a potential issue.
Essentially, all this script should be doing is going through the text file, looking for any string of ',100,0.0,10000000,' and replacing it with ',128,'.
I removed the coding so that it reads:
#parameters are valid
arg = ARGV.join(' ')
arg = arg.gsub(/:/,'/').insert(0,'/Volumes/')
if arg.nil? || arg.strip.empty? then
warn "Usage: $0 [filename]"
elsif !File.exists?(arg) then
warn "File: [%s] Cannot be found." % arg
# Loading up file
data = File.open(arg).readlines
# Selects correct template
old_border = ',100,0.0,10000000,'
new_border = ',128,'
data.each do |line|
However, I am still running across the same issue. It replaces the text, but with an empty string.
Originally Posted by Jacques1
this doesn't make a lot of sense to me. What's with the keep hash? You don't fill it anywhere, yet you assume that it contains ... something.