Skip to content

Instantly share code, notes, and snippets.

@afidegnum
Created October 13, 2018 12:25
Show Gist options
  • Save afidegnum/084ec08487027198c4b1d8a91d1a37b0 to your computer and use it in GitHub Desktop.
Save afidegnum/084ec08487027198c4b1d8a91d1a37b0 to your computer and use it in GitHub Desktop.
cjPath := "cj_items"
files, err := ioutil.ReadDir(cjPath)
if err != nil {
log.Fatal(err)
}
for _, f := range files {
if filepath.Ext(f) == ".txt" {
// csv import
csvFile, _ := os.Open(f.Name())
reader := csv.NewReader(csvFile)
// open database
db, err := dburl.Open(*fURL)
if err != nil {
log.Fatal(err)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment