New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
detect columns
fails to parse cell contents that include spaces
#4183
Comments
|
@fdncred I wonder if |
I played around a bit more with this and you can overcome spaces in columns by replacing it like this
but it still doesn't parse the created and status columns correctly, which I just think may be a bug in detect columns. from ssv works nicely with this type of data though
One of the things I like about having both of these commands is that if one fails we have the other one to try. They work differently and I think that's good. I'm not sure if we should have 2 commands like this or not. I suspect it would be difficult to merge them. I've also explored
|
# Description @fdncred found another histogram based algorithm to detect columns, and rewrite it in rust: https://github.com/fdncred/guess-width I have tested it manually, and it works good with `df`, `docker ps`, `^ps`. This pr is going to use the algorithm in `detect columns` Fix: #4183 The pitfall of new algorithm: 1. it may not works well if there isn't too much rows of input 2. it may not works well if the length of value is less than the header to value, e.g: ``` c1 c2 c3 c4 c5 a b c d e g h i j k g a a q d a v c q q | detect columns ``` In this case, users might need to use ~~`--old`~~ `--legacy` to make it works well. # User-Facing Changes User might need to add ~~`--old`~~ `--legacy` to scripts if they find `detect columns` in their scripts broken. # Tests + Formatting Done # After Submitting NaN
After the latest changes to the
|
Describe the bug
Using the example output from the docker ps documentation:
Here's how
detect columns
parses it:There are two errors in this output, both related to cell contents that include spaces:
CONTAINER ID
column is split into two columns, with identical content;How to reproduce
~/docker-ps.txt
file with the contents indicated above~/docker-ps.txt | detect columns
Expected behavior
The correct output should be:
Screenshots
No response
Configuration
Additional context
If it helps,
from ssv
is able to correctly identify cell contents that include spaces:(There's a separate bug in this output, in that the empty PORTS column isn't properly detected, but I've reported that separately as #4182.)
The text was updated successfully, but these errors were encountered: