Skip to content

Instantly share code, notes, and snippets.

@jmbataller
Created August 4, 2020 08:39
Show Gist options
  • Save jmbataller/7c67214e59c0db585f3508d515664635 to your computer and use it in GitHub Desktop.
Save jmbataller/7c67214e59c0db585f3508d515664635 to your computer and use it in GitHub Desktop.
Generate a dummy CSV file with python
```
import os
import random
import uuid
from datetime import datetime
import string
with open("test.csv", "w") as file:
for x in range(0,10000):
file.write(
str(random.randrange(1000000, 9999999)) + "," +
str(random.randrange(10000, 99999)) + ",1," +
str(random.randrange(100000, 999999)) + "," +
str(uuid.uuid4()) +
datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ".000000000," +
str(uuid.uuid4()) +
"TEST" + ",,TEST_OUT," +
''.join(random.choice(string.ascii_lowercase) for i in range(10)) + "@perf-test.com\n")
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment