-1

The file size is more than 40 GB. Want to find some text and replace it. I will be grateful if I will get some suggestion how to do it. There are three steps: 1. find space and remove it 2. find > symbol and replace it with "> ". 3. find < symbol and replace it with " <".

1 Answers1

0

You could use sed:

sed -ie "s/>/\">\"/g" /path/to/file
  • -i: edit in place
  • -e: run the following command
  • "s/text/replacement/g": replace every occurrence of text with replacement
Phydeaux
  • 2,795
  • 3
  • 17
  • 35