Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. from FCC_database.file_read_backwards import FileReadBackwards
  2.  
  3. with FileReadBackwards("FCC_database/EN.dat",encoding="utf-8") as in_file, open("calldata.txt", 'w') as out_file:
  4. callsign_list = []
  5. skipped_list = []
  6. for line in in_file:
  7. line_list = line.split('|')
  8. if line_list[4] in callsign_list:
  9. skipped_list.append(line_list[4])
  10. else:
  11. callsign_list.append(line_list[4])
  12. out_file.write(line_list[4] + "," + line_list[17] + "," + line_list[7] + "\n")
  13.  
  14. with open("callsign.lst", 'w') as list_file:
  15. for each in skipped_list:
  16. list_file.write(each + "\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement