开发者

strip text within certain paramaters in any language that has a good free IDE for OSX

开发者 https://www.devze.com 2023-02-10 17:58 出处:网络
I have a txt file that I want to sort of \'grep\' through and get rid anything between and including \'&lt\' and \'&gt\'.i am using osx so if you want to recommend开发者_Go百科 a good, free ID

I have a txt file that I want to sort of 'grep' through and get rid anything between and including '&lt' and '&gt'. 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("&lt*&gt",""), something like that? Is that java or what?


You can use sed for this. Try sed "s/&lt[^>]*&gt//g" file.html

That will replace all occurrences of &lt[^>]*&gt (which is a basic regular expression for all text between &gt and )

For more details, see:

  • http://www.gnu.org/software/sed/manual/html_node/Regular-Expressions.html
  • http://en.wikipedia.org/wiki/Sed
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号