remove_digits.py 302 B

123456789101112131415
  1. import re
  2. source = open("../data/1984_fragment.txt", "r")
  3. #source = open("joyce.txt", "r")
  4. destination = open("../data/1984_no_digits.txt", "w")
  5. sentences = []
  6. for line in source:
  7. result = ''.join([i for i in line if not i.isdigit()])
  8. destination.write(result)
  9. source.close()
  10. destination.close()