When you create a pipeline, you often need to read data from some external source, such as a file or a database. Likewise, you may want your pipeline to output its result data to an external storage system. Beam provides read and write transforms for a number of common data storage types.
Package textio contains transforms for reading and writing text files. textio.Read reads a set of files and returns the lines as a PCollection.
Kata: Read the ‘countries.txt’ file and convert each country name into uppercase.