How to combine lines?

Hi,

I have a file like this:

"sdfc@abc.com","arovls","some addr
", "more stuff"
"ssss@email.com","arovls","some addr", "sss"
"edx@email.com","arovls","some addr", "sssdfvv"
"ssss@a55.com","arovls","some addr", "lsdsdgf"
"ssss@0234.com","aro
vls","123
Main", "lSdfv"

I want to combine lines if the first field in the record is an email address and the start of the succeeding lines is not an email address.

For Example, I want the above output to be:

"sdfc@abc.com","arovls","some addr", "more stuff"
"ssss@email.com","arovls","some addr", "sss"
"edx@email.com","arovls","some addr", "sssdfvv"
"ssss@a55.com","arovls","some addr", "lsdsdgf"
"ssss@0234.com","arovls","123 Main", "lSdfv"

Thanks in advance for your help!

Ernie

Hi

awk -F, 'NR!=1 && $1 !~ /\@/{x=x" "$0;next;}{if(NR!=1){print x;x=$0;}else x=$0;}END{print x}' file

Guru.

awk '/@/ {printf "\n"}{printf $0}' urfile
tr "\n" "|" < file|sed 's/\"|\"/\"\n\"/g'

Thanks for your help all.... The following worked for me.

awk -F, 'NR!=1 && $1 !~ /\@/{x=x" "$0;next;}{if(NR!=1){print x;x=$0;}else x=$0;}END{print x}' file