Skip to content

Instantly share code, notes, and snippets.

@ryu1
Created March 13, 2020 07:52
Show Gist options
  • Save ryu1/4de461084d93cacf48489fa144145815 to your computer and use it in GitHub Desktop.
Save ryu1/4de461084d93cacf48489fa144145815 to your computer and use it in GitHub Desktop.
This script can generate dummy CSV file.
#!/bin/bash
echo `date`" start"
for i in `seq 0 7000000`
do
year=$((RANDOM%8+2012))
month=$((RANDOM%12+1))
day=$((RANDOM%29+1))
hour=$((RANDOM%24))
min=$((RANDOM%60))
sec=$((RANDOM%60))
ms=$((RANDOM%1000))
date="$(printf "%04d" ${year})-$(printf "%02d" ${month})-$(printf "%02d" ${day}) $(printf "%02d" ${hour}):$(printf "%02d" ${min}):$(printf "%02d" ${sec}).$(printf "%03d" ${ms})"
echo "$i,$date,dummy" >> ./temp.txt
done
echo `date`" end"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment