Skip to content

Instantly share code, notes, and snippets.

@vodrazka
Created May 5, 2016 20:06
Show Gist options
  • Save vodrazka/600efa365ad34c31ae57887ca7c9df4e to your computer and use it in GitHub Desktop.
Save vodrazka/600efa365ad34c31ae57887ca7c9df4e to your computer and use it in GitHub Desktop.
func main() {
//ecs.Start(ecs.Configuration{FpsLimit: 30}, &MyScene{})
// Load a TXT file.
f, _ := os.Open("a")
defer f.Close()
// Create a new reader.
r := csv.NewReader(bufio.NewReader(f))
r.Comma = ';'
for {
record, err := r.Read()
// Stop at EOF.
if err == io.EOF {
break
}
// Display record.
// ... Display record lengthe
// ... Display all individual elements of the slice.
fmt.Println(record)
fmt.Println(len(record))
for value := range record {
fmt.Printf(" %v\n", record[value])
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment