Documentation
¶
Overview ¶
Example ¶
package main import ( "fmt" "simonwaldherr.de/go/golibs/csv" ) var userdata string = `id;name;email 0;John Doe;jDoe@example.org 1;Jane Doe;jane.doe@example.com 2;Max Mustermann;m.mustermann@alpha.tld` func main() { csvmap, k := csv.LoadCSVfromString(userdata) for _, user := range csvmap { fmt.Println(user[k["email"]]) } }
Output:
Example (Fourth) ¶
package main import ( "fmt" "simonwaldherr.de/go/golibs/csv" ) func main() { csvmap, k := csv.LoadCSVfromFile("./test.csv") for _, user := range csvmap { fmt.Println(user[k["email"]]) } }
Output: jDoe@example.org
Example (Second) ¶
package main import ( "fmt" "simonwaldherr.de/go/golibs/csv" ) func main() { csvmap, k := csv.LoadCSVfromFile("./test.csv") for _, user := range csvmap { fmt.Println(user[k["email"]]) } }
Output:
Example (Third) ¶
package main import ( "fmt" "simonwaldherr.de/go/golibs/csv" ) var userdata2 string = `id;name;email 0;John Doe;jDoe@example.org` func main() { csvmap, k := csv.LoadCSVfromString(userdata2) for _, user := range csvmap { fmt.Println(user[k["email"]]) } }
Output: jDoe@example.org
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadCSVfromFile ¶
LoadCSVfromFile parses a CSV from a file and returns two maps one map with the data and another one with the csv head
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.