BurntSushi / xsv

A fast CSV command line toolkit written in Rust.
The Unlicense
10.29k stars 317 forks source link

Bug in search regex ? #291

Closed udf2457 closed 2 years ago

udf2457 commented 2 years ago

Was messing around with the Tranco list and xsv (0.13.0) today and came across a possible bug.

xsv search -s 2 'uk$' top-1m.csv | grep -Ev 'uk$'         
1,google.com

Surely that's not right ?

BurntSushi commented 2 years ago

Please provide a minimal reproduction.

udf2457 commented 2 years ago

@BurntSushi Erm....

I'm not sure how much more "minimal" I can get than the one-liner I provided above and my use of an open-source csv file ?

BurntSushi commented 2 years ago

"minimal" doesn't just apply to the command. It also applies to the input. You gave me a link to a web site, and that link mentions the word csv precisely zero times. I don't know what you downloaded. Please provide the input data here. Ideally, it would only contain the record that is matching but shouldn't be. Otherwise, please provide a direct link to download precisely the data you're using.

ghuls commented 2 years ago

First line of a CSV file is used as a header by default.

xsv search -n -s 2 'uk$' top-1m.csv
udf2457 commented 2 years ago

it would only contain the record that is matching but shouldn't be

See my original post. It contains the line that is matching but shouldn't be.

ghuls commented 2 years ago

Add -n for not using the first line as a header.

BurntSushi commented 2 years ago

@udf2457 This is a very frustrating exchange for me. If you don't want to work with me to find a resolution to your problem, then don't file a bug reports. In the future, please provide the inputs.