-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransformData.py
More file actions
29 lines (20 loc) · 890 Bytes
/
transformData.py
File metadata and controls
29 lines (20 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#import sys
import re
class transformData:
inputFile = input("Enter the name of the input file: ") # sys.argv[1]
outputFile = input("Enter the name of the output file: ") # sys.argv[2]
with open(inputFile) as f:
for messages in f:
m = re.search(r"\|.*", messages)
print(m.group(0))
m = m.group(0)
projectName = re.search(r"((?<=artifactId\":\")).*(?=\",\"version)", messages)
print(projectName.group(0))
projectName = projectName.group(0)
projectVersion = re.search(r"((?<=version\":\")).*?(?=\")", messages)
print(projectVersion.group(0))
projectVersion = projectVersion.group(0)
output = open(outputFile, "a")
output.write(str(projectName) + ":" + str(projectVersion) + str(m) + "\n")
output.close()
f.close()