This post links to four articles on how to read data line by line from a simple text file. The four articles are all very similar but detail different methods of accessing the data. They all consist of five steps:
- Defining the file
- Opening the file
- Reading in the data
- Doing something with the data
- Outputting the result
The articles are:
- Extract data from a simple text file
- Extract data from gzipped text files - useful if the individual files are large. The biggest bottleneck is disc access times, especially HDDs.
- Extract data from zipped text files (zip archives)
- Extract data from a directory of text files - it's often the case that you want to analyse data from a whole raft of files.
Hopefully they will be of use.