remove newline between two string with sed command in unix shellscript

I have a file (test.dat) which contains data like this

459|199811047|a |b |shan
kar|ooty|
460|199811047|a |bv |gur
u|cbe|

but I need it like:

459|199811047|a |b |shankar|ooty|
460|199811047|a |b |guru|cbe|

While reading the data from this file, I don't want to remove newline from the end of each record. I just want to remove the \n between two string (like:shankar) inside the pipe symbol.

actually inside the unix my dat file... consist of 500 character.. so the first 300 character appear in the first line and got break(newline)for the next 200 character... but the 500 should be treated like single line.. so am trying to append the characters which has got break because of newline. am using | as delimiter..plz help me... with sed command..

perl -p0e 's/(\w)\n(\w)/\1\2/g' file

is there any other command with the help of sed.. because perl command not supported in my unix.. if u dont mind plz help me am new to this.

paste -d'\0' - - < input_file

Try:

sed 'N;s/\n//' infile