Skip to content
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

Shuffle rows: csvtk shuf /or/ csvtk sort -R #151

Open
tseemann opened this issue Jun 20, 2021 · 3 comments
Open

Shuffle rows: csvtk shuf /or/ csvtk sort -R #151

tseemann opened this issue Jun 20, 2021 · 3 comments

Comments

@tseemann
Copy link

I want to randomly re-order the rows in my CSV file.

Basically unix shuf or sort -R but for xSV data.

The actual use case is to shuffle the data before using csvtk uniq -n 40 say.
Is this possible?

@VladimirAlexiev
Copy link

shuf has feature -n to output only N rows, very important for taking a sample out of a big file.

@avilella
Copy link

avilella commented Jul 28, 2022

Has this been implemented into csvtk? Or is it a matter of piping into shuf? If so, how can we skip the header line from the shuffling? Thanks in advance.

@shenwei356
Copy link
Owner

Not yet, it should be easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants