Created
October 13, 2018 12:25
-
-
Save afidegnum/084ec08487027198c4b1d8a91d1a37b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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