-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 " <".

3
  • 1
    Grep... since you've tagged this shell. Commented Sep 14, 2017 at 12:35
  • 1
    One good way to find out how to do it is to search for your exact question and look at the answers. Commented Sep 14, 2017 at 12:38
  • stackoverflow.com/questions/17140886/… Commented Sep 14, 2017 at 12:45

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

1 Comment

Not my downvote... but this seems correct, so why downvote it?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.