path Users entropy TEST Lsqltext 200131231859 file open path rows file

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
path = '/Users/entropy/TEST/Lsqltext.200131231859'
file = open(path, 'r')
rows = file.read().split('}}')
q = True
for row in rows:
tmp0 = row.split(' ')
tmp1 = tmp0[-1].split('\t')
tmp2 = tmp1[-1].split(' ')
tmp3 = tmp1[-1].split('{{')
total = tmp0[:-1] + tmp2[:-1] + tmp3[:-1]
if q:
print(total)
q = False