Skip to content

Instantly share code, notes, and snippets.

@dewanshrawat15
Created July 12, 2019 16:46
Show Gist options
  • Save dewanshrawat15/a9ae67ea37ff7dac94c1bfe193c66dbc to your computer and use it in GitHub Desktop.
Save dewanshrawat15/a9ae67ea37ff7dac94c1bfe193c66dbc to your computer and use it in GitHub Desktop.
output = open("output.txt", "w")
temp = open("names.txt", "r")
x = temp.read()
x = x.splitlines()
print(x)
t = ''
for i in x:
for j in i:
if j.isalpha() or j == ' ':
t = t + j
t = t + '\n'
output.write(t)
Just a normal script to truncate all numbers and special characters and allow only spaces and alphabets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment