In the case where I needed to combine two lines (for easier processing), but allow the data past the specific, I found this to be useful
data.txt
string1=x
string2=y
string3
string4
cat data.txt | nawk '$0 ~ /string1=/ { printf "%s ", $0; getline; printf "%s\n", $0; getline } { print }' > converted_data.txt
output then looks like:
converted_data.txt
string1=x string2=y
string3
string4