[go-nuts] Re: import csv file

2016-08-19 Thread francis badasu
loud and clear -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optou

Re: [go-nuts] Re: import csv file

2016-08-19 Thread asit dhal
+1 Warm Regards, Asit Dhal http://bit.ly/193ASIT On 8/20/2016 2:14:47 AM, Shawn Milochik wrote: To everyone participating in this thread: Google "help vampire" To OP: don't be one. To everyone else: Don't feed them. -- You received this message because you are subscribed to the Google Groups

[go-nuts] Re: import csv file

2016-08-19 Thread Shawn Milochik
To everyone participating in this thread: Google "help vampire" To OP: don't be one. To everyone else: Don't feed them. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an e

[go-nuts] Re: import csv file

2016-08-19 Thread francis badasu
Yh, thanks so much. but still getting this error when i run it. undefined: sql in sql.Open > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsu

[go-nuts] Re: import csv file

2016-08-19 Thread Tamás Gulácsi
sth. like records, err := reader.ReadAll() if err != nil { log.Fatal(err) } db, err := sql.Open("sqlite", "memory") if err != nil { log.Fatal(err) } defer db.Close() tx, err := db.Begin() if err != nil { log.Fatal(err) } stmt, err := tx.Prep("INSERT INTO my_table (a, b, c) VALUES (?,

[go-nuts] Re: import csv file

2016-08-19 Thread francis badasu
This is a snippets of the first part of my code package main import ( "encoding/csv" "fmt" "os" ) func main() { file, err := os.Open("Account_balances.csv") if err != nil { fmt.Println("Error", err) return } defer file.Close() reader := csv.NewReader(file) record, err := reader.Rea

[go-nuts] Re: import csv file

2016-08-18 Thread Asit Dhal
There is a csv package in golang https://golang.org/pkg/encoding/csv/ There is a sql package in golang too https://golang.org/pkg/database/sql/ For sqlite https://godoc.org/github.com/gwenn/gosqlite You need to use csv parser and insert into sqlite database. Warm Regards, Asit http://bit.ly/19