ProjektPython/utils/csv_generator.py

37 lines
845 B
Python

#!/usr/bin/python
fileOut = open('../datasets/out.csv', 'w')
file = open('../datasets/regular_web_form_data.txt', 'r')
Lines = file.readlines()
for line in Lines:
fileOut.write("normal,'" + str(line).strip().replace("\n", "") + "'\n")
file.close()
file = open('../datasets/os-command-injection.txt', 'r')
Lines = file.readlines()
for line in Lines:
fileOut.write("os-command-injection,'" + str(line).strip().replace("\n", "") + "'\n")
file.close()
file = open('../datasets/sql-injection.txt', 'r')
Lines = file.readlines()
for line in Lines:
fileOut.write("sql-injection,'" + str(line).strip().replace("\n", "") + "'\n")
file.close()
file = open('../datasets/xss.txt', 'r')
Lines = file.readlines()
for line in Lines:
fileOut.write("xss,'" + str(line).strip().replace("\n", "") + "'\n")
file.close()
fileOut.close()