miller/scripts/make-big-files
2021-12-12 23:37:03 -05:00

23 lines
496 B
Bash
Executable file

#!/bin/bash
set -x
mkdir ~/tmp/
mlr --csv \
repeat -n 100000 \
then shuffle \
then put '
begin{@index=1}
$k = NR;
@index += urandint(2,10);
$index=@index;
$quantity=fmtnum(urandrange(50,100),"%.4f");
$rate=fmtnum(urandrange(1,10),"%.4f");
' \
docs/src/example.csv > ~/tmp/big.csv
mlr --c2d cat ~/tmp/big.csv > ~/tmp/big.dkvp
mlr --c2j cat ~/tmp/big.csv > ~/tmp/big.json
mlr --c2n cat ~/tmp/big.csv > ~/tmp/big.nidx
mlr --c2x cat ~/tmp/big.csv > ~/tmp/big.xtab