I am fairly new to python.I am currently using python scripting.My problem is,I have some txt files from which i need to extract only words(characters) and remove digits,new lines and special characters(like ----, []) and store it in a another txt file with a different name.
Please help.
enigmaenigma
0
Newbie Poster
Recommended Answers
Jump to PostHere is a mild hint:
import re s = "Lotus 123 is an older spread-sheet, still in use though!" # sub all characters with empty "" that are not letters p = re.compile("[^a-z A-Z]") s2 = p.sub("", s) print s2 # Lotus is an older spreadsheet still …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.