strip text within certain paramaters in any language that has a good free IDE for OSX
I have a txt file that I want to sort of 'grep' through and get rid anything between and including '<' and '>'. i am using osx so if you want to recommend开发者_Go百科 a good, free IDE, or if I can just do it with emacs and probably already have a compiler of some sort on the OS. so, I am looking for the script mainly, in whatever language. ReplaceAll("<*>",""), something like that? Is that java or what?
You can use sed for this. Try sed "s/<[^>]*>//g" file.html
That will replace all occurrences of <[^>]*>
(which is a basic regular expression for all text between >
and )
For more details, see:
- http://www.gnu.org/software/sed/manual/html_node/Regular-Expressions.html
- http://en.wikipedia.org/wiki/Sed
精彩评论