Beta · version 0.8.1 · commands and the JSON format may still change.
First, random and last rows together
mixed keeps the start of the file, its end and a random draw from the rows
between them, in one sample and in file order.
tabalyst sample customers.csv --sample-method mixed --first-rows 100 --random-rows 800 --last-rows 100 --seed 42Key points
Section titled “Key points”- Use it when you want to see how a file begins and ends, and what is in the middle.
- Size:
--first-rows,--random-rowsand--last-rows, each 0 or more, at least one above 0.--rowsand--percentare errors (exit code 2). - No repeated row: the random rows are drawn among the rows that the start and the end did not keep.
- File shorter than the request: the start is served first, the end keeps what the start left, and the random draw takes what is left of both. With 100 rows, 75 first and 75 last give the 100 rows of the file, each once.
- Cost: two readings of the file.
- Seed:
--seedmakes the random rows reproducible. It is an error when--random-rowsis 0 or absent. - Output:
customers.sample.csvbeside the source. The summary shows the rows kept in each part (Parts: 100 first, 800 random, 100 last).
Limits
Section titled “Limits”- The random rows are not stratified. For the proportions of a column use a stratified sample; for the rare cases use a smart sample.
--first-rows,--random-rowsand--last-rowsare errors with any other method (exit code 2).
See Tabalyst Sample for output locations and CSV formats.