Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby get line from a file

# open the file
file = File.open('foo.txt')

# iterate over each line
file.each_line do |line|
  puts line
end

# close the file afterwards
file.close
 
PREVIOUS NEXT
Tagged: #ruby #line #file
ADD COMMENT
Topic
Name
9+4 =