Tag Archives: sed

How to replace the 4th occurrence of a character in a file using sed

sed -i “s/\”/ \”/4″ myFile.txt The above command will replace the 4th occurrence of “ by “ in file “myFile.txt”, which is equivalent to putting a space in front of the 4th double quote.

Posted in Uncategorized | Tagged | Leave a comment