sed tricks
Search and replace over multiple lines:  sed -i -e ':a' -e 'N' -e '$!ba' -e 's/)\n(/),\n(/g' file
Tags: sed, linux, data, sql