To not change the specified line in sed
line 8:
sed '8!s/string/newstring/g' file.txt