This is very simplistic, but may work for you:
# cat <<\! | sed ':a;/"$/{P;D};N;s/\n//g;ba' > "Value1", "Value2", "This is a longer piece > of text with > newlines in it.", "Value3" > "Value4", "Value5", "Another value", "value6" > ! "Value1", "Value2", "This is a longer piece of text with newlines in it.", "Value3" "Value4", "Value5", "Another value", "value6"
source share