-
-
Save alexander-beaver/ca330c43d27357ceb6fde0a58f9b6049 to your computer and use it in GitHub Desktop.
Convert Python
This file contains 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
import sys | |
fileNameToRead = sys.argv[1] | |
try: | |
file_object = open(fileNameToRead, 'r') | |
text = file_object.readlines() | |
output = [] | |
for line in text: | |
line = line.replace("network_table:///","") | |
line = line.replace("LiveWindow/","") | |
line = line.replace("SmartDashboard/","") | |
output.append(line) | |
print(output) | |
write_object_name = fileNameToRead.replace(".csv","")+"-converted.csv" | |
write_file = open(write_object_name, 'w+') | |
for line in output: | |
write_file.write(line) | |
write_file.close() | |
file_object.close() | |
except Exception as e: | |
print(str(e)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment