Guest User

Untitled

a guest
Nov 17th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import pandas as pd
  2.  
  3. tags = ['129','30','32','851','9730','9882']
  4. rows = []
  5.  
  6. file = open('D:\python\redi_fix\redi_august.txt','r')
  7. content = file.readlines()
  8. for line in content:
  9. for message in line.split('t'):
  10. try:
  11. row_dict = {}
  12. tag,val = message.split('=')
  13. if tag in tags:
  14. row_dict[tag]=val
  15. rows.append(row_dict)
  16. except:
  17. pass
Add Comment
Please, Sign In to add comment