Filter NFC Cockpit log information and add required timestamping

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Filter NFC Cockpit log information and add required timestamping

582 Views
BrunoSenzio
Contributor III

We would like to share a way and script to create custom logs form the NFC Cockpit GUI, could be of use if timing is needing for detecting reading distances.

Just copy all the information from the log window and create a random file to then filter out with a custom script.

Hoping it to be of use.

Best,

 

BSSB

0 Kudos
1 Reply

576 Views
BrunoSenzio
Contributor III

# NFC Cockpit Parsing script

import csv

if __name__ == "__main_":

with open('log_nfc.txt') as f:
log = f.readlines()


output = []
for line in log:
if "INFO" in line:
time_data = line[12:20]
hour, min, sec = time_data.split(':')
output.append([hour, min, sec])

fields = ['Hour', 'Minute', 'Second']
with open('parsed_nfc.csv', 'w') as f:
write = csv.writer(f)
write.writerow(fields)
write.writerows(output)

0 Kudos