Common operations for text file.