Created
September 25, 2019 09:47
-
-
Save kieranjol/84dd9caf81a0ed3fff79e3eff5fe2d4c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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