25 with io.open(file_name + ".tsv", mode="r", encoding="windows-1252") as tsv:
26 for line in tsv:
27 csv.write(re.sub('\t', ',', re.sub(
28 '(^|[\t])([^\t]*\,[^\t\n]*)', r'\1"\2"', line))) 29
30 # csv.close()
31
6@author: Vivekanand Koya
7"""
8# Sets Containing ASCII values for different groups of characters
9ASCII = ["@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "\[","\\","\]", "^", "_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~"]10LowerCaseLetters = ASCII[33:59]
11UpperCaseLetters = ASCII[1:27]
12Alphabet = LowerCaseLetters + UpperCaseLetters
6@author: Vivekanand Koya
7"""
8# Sets Containing ASCII values for different groups of characters
9ASCII = ["@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "\[","\\","\]", "^", "_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~"]10LowerCaseLetters = ASCII[33:59]
11UpperCaseLetters = ASCII[1:27]
12Alphabet = LowerCaseLetters + UpperCaseLetters
Backslash is present in the literal string but is not a valid escape sequence. If it is intended to be an escape sequence, use the correct escape characters. If it is intended to be a literal backslash, it can either be replaced with with an escaped backslash \\
, or you can add an r
prefix to make it a "raw" string.
filepath = "C:\myfiles\run.py"
filepath = "C:\\myfiles\\run.py" # use `\\` to render one backslash
filepath = r"C:\myfiles\run.py" # use the `r` prefix to avoid unnecessary escapes