CSV files are plain text files with a format. In this section, you will learn how to read a text file that contains points of a plane, which means that each line will contain a pair of coordinates. Additionally, you are also going to use an external Go library named Glot, which will help you to create a plot of the points that you read from the CSV file. Note that Glot uses Gnuplot, which means that you will need to install Gnuplot on your UNIX machine in order to use Glot.
The name of the source file for this topic is CSVplot.go, and it is going to be presented in five parts. The first code segment is as follows:
package main import ( "encoding/csv" "fmt" "github.com/Arafatk/glot" "os" "strconv" )
The second part of CSVplot.go is shown in the following Go code:
func main() { ...