I am doing a c# project with sqlite as database, the problem is that the csv exporter is…
Jump to turn (6)
- 1I am doing a c# project with sqlite as database, the problem is that the csv exp
- 2it still doesn't work, now the written value is this: -1950261086,11,'01/01/2018
- 3ok now the values aren't negatives but the values are wrong: the written values
- 4it works, but it writes an empty line at the end, how to avoid adding this empty
- 5it works perfectly, now can you make the code to import this csv?
- 6this is my current importer code, but it takes too much time to import because I
- User
I am doing a c# project with sqlite as database, the problem is that the csv exporter is writing negative numbers because the getvalue doesn't take into account that integer in sqlite can have long values.
Here is a real database value: 20180101062818 11 01/01/2018 06:28:18 01/01/2018 20:07:38 0 0 22.0 0.0 1690.0 0.0 0.0 0.0 1712.0 0.0 0.0 0.0 0.0 0.0 150.0 0.0 0.0 0.0 0.0 0.0 1862.0 1862.0 20180101200738
Here is the written value: -1950261086,11,"01/01/2018 06:28:18","01/01/2018 20:07:38",0,0,22,0,1690,0,0,0,1712,0,0,0,0,0,150,0,0,0,0,0,1862,1862,"","","",-1950123166
and here is my code to export to csv file:
var values = Enumerable.Range(0, reader.FieldCount) .Select(i => reader.GetValue(i)) .Select(v => v is string ? $""{v}"" : v) .ToArray(); csv.AppendLine(string.Join(",", values));
- Assistant