You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest release: idk
What did you do?
when I fetch the records via this code from CSV from the below code and then write back the records in another file then some of the records are missing.
func getcsvData(filePath string) [][]string {
f, err := os.Open(filePath)
if err != nil {
log.Fatal("Unable to read input file "+filePath, err)
}
defer f.Close()
csvReader := csv.NewReader(f)
records, err := csvReader.ReadAll()
if err != nil {
log.Fatal("Unable to parse file as CSV for "+filePath, err.Error())
}
return records
}
func writeback(){
records := getcsvData(file)
sorted, err := os.OpenFile("new.csv", os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0777)
if err != nil {
panic(err.Error())
}
sortedwriter := csv.NewWriter(sorted)
for _, item := range records {
if err = sortedwriter.Write(item); err != nil {
panic(err)
}
}
sortedwriter.Flush()
sorted.Close()
}
What did you expect to see?
all the records
What did you see instead?
when I ran on 109157 records read then it wrote 109144 records
The text was updated successfully, but these errors were encountered:
Does this issue reproduce with the latest release: idk
What did you do?
when I fetch the records via this code from CSV from the below code and then write back the records in another file then some of the records are missing.
What did you expect to see?
all the records
What did you see instead?
when I ran on 109157 records read then it wrote 109144 records
The text was updated successfully, but these errors were encountered: