When sequential files are opened, we must specify whether they will be read from with a StreamReader or written to with a StreamWriter. Output files can be created anew (File.CreateText) or just added to (File.AppendText). A line of data is written to a file with the WriteLine method and read from a file with the ReadLine method.
Structured exception handling can reduce the likelihood that a program will crash. If an exception occurs while the code in the Try block is running, execution branches to the code in a Catch block that alerts the user of a mishap. The Finally block does its best to clean up before the program moves on to other tasks.
When data are stored with CSV format, an entire record is placed in a single line with fields separated by commas.
A sequential file can be ordered by placing its data in an array of structures, sorting the array, and then writing the ordered data into a file.