For e.g you go the text file called text.txt
with the following details
Hello world I’m am a nice guys
Hello world I’m am a bad guys
line_count = 0
text = ’ ’
File.open(“text.txt”).each do | line |
line_count = 0
text << line
end
The above code means it will retrieve the text file
And add beside a line_count +1 right?
Hello world I’m a nice guys line_count + 1
Hello world I’m a bad guys line_count + 2
Am I’m correct when explaining this code?