Get the First, Last, or N Line of a Text File in Ruby By JeffPosted on April 11, 2022 # Secret sauce is .to_a lines = File.open(filename).to_a # Get the first line puts lines.first # Get the last line […]