Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- str="abcdefghijklmnopqrstuvwxyz"
- str.each_line do |temp|
- puts temp
- end
- fl = File.open('a2.txt')
- puts fl.lines.count
- fl.close
- count = 0
- fl = File.open('a2.txt').each { |s|
- s = s.chomp
- count = count + 1
- if count == 5
- break
- end
- }
- fl.close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement