-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
32 lines (29 loc) · 691 Bytes
/
test.py
File metadata and controls
32 lines (29 loc) · 691 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
30
31
32
datafile = open("data.txt","r")
outFile = open("newdata.txt","w")
content = datafile.readlines()
content =[x.strip() for x in content]
#datafile.close()
nextRecord = []
for x in content:
nextRecord.extend(x.split('\n'))
#print(any(c in nextRecord[0] for c in 'Salaries'))
#if 'Salary' in nextRecord[0]:
#print('Succes')
#s = 'start'
#newRec =[]
#value = 0
#while s != '':
#s = datafile.readline()
#newRec.append(s.strip())
#if 'DocID' in s:
#print(s.split())
#else:
#print('no')
import pandas as pd
import numpy as np
frame = pd.DataFrame(content)
print(frame)
frame.to_json(outFile)
outFile.close()
datafile.close()
input("press any key to exit")