Replace a string containing :/=\ in files

I have read many forums about replacing a string in file.
I tested but it doesn't work with my string

For example I want to replace =x=ks24Y\:LOP= with h\P6qwx:aUE/.

Thank you

$ printf ">>> %s <<<\n" '=x=ks24Y\:LOP='|sed 's =x=ks24Y\\\:LOP= h\\\P6qwx:aUE/ '
>>> h\P6qwx:aUE/ <<<

Hi,

I want to replace a srting '; with ABCD'; in a file from line 1 to line 65. Is there any single command to do it without using awk

What's wrong with awk? Did you try the solutions posted above?

sed "1,65s/';/ABCD';/" file >newfile

Also, please start a new thread instead of hijacking an old thread unless your question is a direct follow-up.

Thanks era