Skip to content

Instantly share code, notes, and snippets.

@callumj
Created April 20, 2011 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save callumj/931527 to your computer and use it in GitHub Desktop.
Save callumj/931527 to your computer and use it in GitHub Desktop.
file='/Users/callumj/Desktop/test.txt'
f = File.open(file, "r")
f.each_line { |line|
if !line.downcase.include?("total")
randomval = rand(500)
print "#{line[0,line.rindex(',')]},#{randomval}\r\n"
end
}
f.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment