DEV Community

Cover image for Sampling N Lines From a CSV File
Talles L
Talles L

Posted on

Sampling N Lines From a CSV File

$ sudo apt install csvkit

$ csvsql --query "SELECT * FROM myfile ORDER BY RANDOM() LIMIT 3" myfile.csv > mynewfile.csv
Enter fullscreen mode Exit fullscreen mode

Top comments (0)