Created
August 4, 2020 08:39
-
-
Save jmbataller/7c67214e59c0db585f3508d515664635 to your computer and use it in GitHub Desktop.
Generate a dummy CSV file with python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
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