Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reading multiple lines from a file

Status
Not open for further replies.

rajabadsha

Programmer
May 4, 2006
11
CA
If a file "a.txt" has the following lines


Line1: 1
Line2: 2
Line3: 3

How would it read the input sequentially i.e. one line after another and output then sequentially?
 
1) Create an array for storing the lines
2) Open the file
3) Read all the lines
4) Close the file
5) Print the lines
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top