I found this shell command (Code Exchange) to replace text very fast
But if your text contains a ’ (single quot mark) and the search text happens to contain a ’ too you get an error.
How can this be handled? I cannot believe that a simple singlequot can make “sed” fail!
set txt to quoted form of "this is just a test text"
set srch to quoted form of "test"
set repl to quoted form of "foo"
set txt to (do shell script "echo " & txt & "| sed -e 's|" & srch & "|" & repl & "|g' ")
Vince
(*nix noob)