Reading Files
Lesson 26Author : 🦒
Last Updated : November, 2017
Code
File.open("employees.txt", "r") do |file|
for line in file.readlines()
puts line
end
end
# ---------------
# or
# ---------------
file = File.open("employees.txt", "r")
puts file.read
file.close()