Comments (3)
OK, so to be clear here, you're running into an error because your CSV data has multiple rows with varying numbers of columns. The xsv fixlengths
command is what you should be using to resolve that. If you read the xsv fixlengths --help
docs, you'll notice that there is a bit of work that needs to be done to "fix" the CSV data.
So yes, it was very much intentional that xsv
has no way to "skip" bad records. In particular, there is no obvious way to know which records are bad and which aren't. There is a fundamental ambiguity here. This isn't necessarily about your CSV data being malformed so much as xsv
has no obvious way to interpret it. It might be obvious to you, but that's why xsv fixlengths
exists. Use that to make it obvious to xsv
.
from xsv.
Am I just supposed to take your word for it? :-) Could you please show an example?
xsv
should never crash on any input.
It might return errors in some cases. And what to do in those cases depends on what you're trying to do. But you didn't give any examples nor did you describe what you're trying to do nor the output of xsv
when it crashed.
(If it were possible, I would love to have a --please-no-bugs
that one could pass to any program to prevent it from crashing. :P)
from xsv.
My apologies, I picked the wrong word. xsv
indeed doesn't crash - it exits with an error, which is correct, as my input CSV file is malformed (too many columns). In looking into this problem I stumbled upon csvclean from csvkit which can be used to fix/remove bad lines from my CSV file. Given that xsv
already has the fixlengths command, perhaps adding a flag to skip lines with errors wouldn't be too much trouble?
from xsv.
Related Issues (20)
- Completions
- feature request: write stdout to pager command
- Please add Contributing.md HOT 2
- On motivation HOT 4
- --compress-program option for xsv split? HOT 4
- Investigate increasing Maintainer Productivity with Pull Requests Environments HOT 1
- "@list" external parameter list
- Split a column
- xsv fixlengths never finishes on some input HOT 1
- How to avoid extra quotes HOT 1
- Is it possible to generate a new csv from the associated fields of two csv's? HOT 2
- Use file name patterns in cat HOT 1
- New build needed for `reverse`
- Scanning of "cargo-geiger" showed unsafe code HOT 1
- xsv might silently fail
- Cargo test failed on Windows
- fixlengths -- insert extra commas not at end
- Escaping unescaped quotes in quoted strings modifies the data HOT 2
- support unbalanced partitioning HOT 1
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 xsv.