Skip to content

Instantly share code, notes, and snippets.

@geremachek
Last active November 19, 2022 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geremachek/7b1e565b3c8081b16d26be3051a9fb01 to your computer and use it in GitHub Desktop.
Save geremachek/7b1e565b3c8081b16d26be3051a9fb01 to your computer and use it in GitHub Desktop.
import csv
with open("decoderaaa.csv", mode='r') as inp:
reader = csv.reader(inp)
ring = {rows[0]:rows[1] for rows in reader}
file_name = input("Enter File Name: ")
input = open(file_name, 'r')
output = open("DECODED-" + file_name, 'w')
for line in input.readlines():
decode_buffer = ""
for ch in line:
decoded = ring.get(ch)
match decoded:
case None: decode_buffer += ch
case other: decode_buffer += decoded
output.write(decode_buffer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment