Menu

Fast find and replace string in a file

Duy Dinh
2012-04-19
2012-04-19
  • Duy Dinh

    Duy Dinh - 2012-04-19

    Find and replace all occurrences of 's1' by 's2' in inputFile, results are written to outputFile

    sed 's/s1/s2>/g' inputFile > outputFile

     
  • Duy Dinh

    Duy Dinh - 2012-04-19

    Remove HTML, XML tag from file:

    sed -i '//,/<\/b>/d' foo.xml

    sed -i '/<CODE>/,/<\/CODE>/d' /home/duy/workspace/cxtractor/nlpdata/ontologies/snomed/collection/snomed.dict.trec

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.