CSV
One of the most common ways a file is structured is as a comma-separated value. This is a clear text file that contains data, which is basically represented as rows and columns. Frequently, these files are used to exchange data. A CSV file has a simple structure. Each piece of data is separated by a comma and then a new line for another record. An example of a CSV file would be as follows:
firstName, lastName, age Celina, Jones, 18 Cailyn, Henderson, 13 Cayden, Smith, 42
- You will, at some point in your life, come across CSV files as they are very common. The Go programming language has a standard library that is used for handling CSV files:
encoding/csv
:
package main import ( Â Â "encoding/csv" Â Â "fmt" Â Â "io" Â Â "log" Â Â "strings" ) func main() { Â Â in := `firstName, lastName, age Celina, Jones, 18 Cailyn, Henderson, 13 Cayden, Smith, 42 ` Â Â r ...