Comments (8)
Are you guys still looking for a fix? I can help!
Yes, still seeing this, thank you!
In linux, for some reason, for some files, you need to have windows style line breaks for it to work.
My file had no issues on csvLint except the line-break warning.
You can use the unix2dos command to convert the file first, then it worked for me.
from pgfutter.
change to this code
https://github.com/lukasmartinelli/pgfutter/blob/master/csv.go#L100
for i, col := range record {
cols[i] = strings.Replace(col, "\x00", "", -1)
// bytes.Trim(b, "\x00")
// cols[i] = col
}
to
for idx, col := range record {
cols[idx] = strings.Replace(col, "\x00", "", -1)
// bytes.Trim(b, "\x00")
// cols[i] = col
}
from pgfutter.
What version of pgfutter? I ask because I had a similar panic on v1.2, but when I built from source it ran fine. There have been a few fixes since v1.2 that may have addressed your issue.
from pgfutter.
I got the same error with a 4MB file, version v1.2.
The problem was that the CSV file was malformed, a few rows had extra columns. I discovered this by validating the CSV file here https://csvlint.io/, the output was very helpful.
from pgfutter.
Are you guys still looking for a fix? I can help!
from pgfutter.
Are you guys still looking for a fix? I can help!
Yes, still seeing this, thank you!
from pgfutter.
Can confirm that running my CSV that was having the index out of range issue through unix2dos
resolved this for macOS.
from pgfutter.
Thank you@waynegraham
Can also confirm that running unix2dos on 18GB of tab-delimited files fixed this issue on Linux 👍
This issue isn't 100% consistent. Some files worked as-is (with Unix line breaks), some did not. After running unix2dos on all, they all worked.
from pgfutter.
Related Issues (20)
- Import text values as null instead of blank HOT 2
- Unable to import JSON
- No longer builds HOT 2
- --table doesn't exist as an option HOT 1
- build failures on master HOT 2
- unable to build with go1.14.2 HOT 1
- cannot understand how to use from the documentation HOT 3
- pq: copyin statement has already been closed HOT 1
- help needed syntax
- Can make it work with amd64.exe or GO source HOT 2
- Pgfutter not working with PostgreSQL13 HOT 5
- Pgfutter command not found error in Ubuntu bash HOT 1
- index out of range error HOT 1
- Does nothing and shows no output HOT 6
- pgfutter doesn't correctly honor --table names HOT 1
- bsdthread_register error HOT 2
- header row case conversion
- panic: runtime error: index out of range
- fail importing a tsv file with more than 1000 columns
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pgfutter.