April 20, 2011

Tester Friend : Fetching data from Text file using Ruby

Print the content in notpad using the below command.


This help you to access the text from a notepad
Step i: Create a text file document "email.txt"
Step ii: Enter the text content line by line and save it

SCRIPT:
File.open("email.txt").each {|line|
email=line
puts line
end

OUTPUT:
Which prints the text in notepad line by line

No comments:

Post a Comment