← Back to Gists

File read lines

📝 Ruby
jorgeharrell188
jorgeharrell188 · Level 11 ·

Quickly read every line from a file into an array using File.readlines in Ruby.

Ruby
lines = File.readlines('data.txt')
puts lines.inspect

Comments

No comments yet. Start the discussion.