Skip to content

Instantly share code, notes, and snippets.

@kieranjol
Created September 25, 2019 09:47
Show Gist options
  • Save kieranjol/84dd9caf81a0ed3fff79e3eff5fe2d4c to your computer and use it in GitHub Desktop.
Save kieranjol/84dd9caf81a0ed3fff79e3eff5fe2d4c to your computer and use it in GitHub Desktop.
#!/usr/bin/env/python3
import sys
import ififuncs
# accept the csv file
csv_file = sys.argv[1]
#process the csv data into a python-friendly format
data = ififuncs.extract_metadata(csv_file)
for traffic in data[0]:
'''
split each record's traffic entries based on the pipe
delimiter and then reverse the order
'''
#print the reversed order
print('|'.join((list(reversed(traffic['Traffic'].split('|'))))))
#print the original order
print(traffic['Traffic'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment