Comments (5)
hi,
and/or adding a --delim
option (or something similar) on the command line to force the definition (in case of detection problem for example)...
regards.
from rich-cli.
OK, apparently the problem is with only sniffing truncated data ([:1024]
) which can break the CSV sniffer algorithm as it tries to detect the delimiter by counting the occurrences on each line (and truncating in the middle of a line will therefore corrupt the data for the sniffer).
Changing the logic to sniff the first N lines instead of first 1024 characters would solve this issue.
from rich-cli.
OK, apparently the problem is with only sniffing truncated data (
[:1024]
) which can break the CSV sniffer algorithm as it tries to detect the delimiter by counting the occurrences on each line (and truncating in the middle of a line will therefore corrupt the data for the sniffer).
Wow, is that the reason why?!? ๐ฒ I've been wondering for years why the code example in the official Python csv.Sniffer docs does not seem to work. I never realized it is because it breaks in the middle of a line. ๐คจ
Seems to me this should be fixed in the official Python docs as well, since I've never managed to get it to work...
Anyway, thanks for this gem! ๐
from rich-cli.
Is there any --delim
or similar option to force delim detection?
from rich-cli.
I just submitted a pull request to add --csv-format
that lets you set the dialect to use.
from rich-cli.
Related Issues (20)
- List of every supported filename extensions HOT 2
- Feature request: support setting `--hyperlinks` via the `RICH_HYPERLINKS` environment variable HOT 3
- --width / --max-width in SVG export don't affect the width of the picture HOT 1
- head / tail operations are slow on larger files
- Provide help for pager
- No lexer fo csv HOT 4
- Multiple emoji encoding issues on Windows HOT 3
- Is it possible to format outputs of commands executed? HOT 4
- feature request: pv equivalent progress bar (using --size) feature HOT 4
- Rich capturing mouse movements from stdin
- Rich as a drop-in replacement for "more"/"less" HOT 1
- Reused option name: -j is used for both JSON and emoji options HOT 2
- Unable to install latest textual and rich-cli together
- Align title to the left in markdown HOT 2
- Feature request: Allow tailing a CSV HOT 2
- `rich --print` always adds an extra newline
- How to set background color inside strings should be documented better HOT 1
- Exposing Text.from_ansi in rich-cli HOT 1
- Feature request: horizontal padding HOT 1
- please detect encoding before opening a file
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 rich-cli.