Misc Cleanup Update

This commit is contained in:
2019-07-04 18:39:01 +02:00
parent 0269c384da
commit 841d47e9c1
7 changed files with 95 additions and 87 deletions

View File

@@ -11,11 +11,15 @@ from datetime import date
import multiprocessing
# randomI function which creates each file
def randomI(units, rows, rowLength, partstart):
for setcounter in range(0, units):
writeFile(generateFile(rows, rowLength), setcounter, partstart)
# Function for generating the content of one single file
def generateFile(rows, rowLength):
content = []
for y in range(0, rows):
@@ -23,6 +27,8 @@ def generateFile(rows, rowLength):
return content
# Function for generating the content of one single row randomly
def generateRow(rowLength):
row = ""
for z in range(0, rowLength):
@@ -30,12 +36,15 @@ def generateRow(rowLength):
return row
# Function for writing data into a file
def writeFile(content, setcounter, partstart):
filenumber = int(setcounter) + int(partstart)
file = open("testdata/file" + str(filenumber) + ".txt", "w")
for w in range(0, len(content)):
file.write(content[w] + "\n")
if __name__ == '__main__':
# Getting the user input
print("Hello World")

View File

@@ -16,9 +16,8 @@
# Importing the time for benchmarking purposes
import time
from datetime import date
# CODE (FUNCTIONS)
# CODE
# EXECUTION