Skip to content

Instantly share code, notes, and snippets.

@hergerr
Last active March 11, 2020 18:03
Show Gist options
  • Save hergerr/63ebb43bce27931c8ba1630abcaba2ab to your computer and use it in GitHub Desktop.
Save hergerr/63ebb43bce27931c8ba1630abcaba2ab to your computer and use it in GitHub Desktop.
import sys
with open(f'{sys.argv[1]}/GT-{sys.argv[1]}.csv') as file:
next(file)
for line in file:
lst = line.rstrip('\n').split(';')
with open(f'{sys.argv[1]}/{lst[0][0:-4]}.txt', 'w') as w_file:
w_file.write(f'{lst[-1]} {int((int(lst[3]) + int(lst[5]))/2)} {int((int(lst[4]) + int(lst[6]))/2)} {abs(int(lst[5]) - int(lst[3]))} {abs(int(lst[4]) - int(lst[6]))}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment