How to delimit a flat file with records with SED

Hi gurus, hoping someone can help with a sed line that can do the following...

I have a flat file with about 1000 records, but in order to import into openoffice spreadsheet, I need to create a delimited file. I'd like to do 2 things with the SED command:
1- add a pipe character "|" at the end of each line
2- (the above will create a double pipe for every two blank links, such as ||). Replace the || double-pipe with carriage returns so in the end I have a delimited file. Im not rigid on how to perform step 2, so any recommendations are appreciated. See the file format below for a better view.

The file format is like this:

Person1
Address
Value1
License Status blah blah blah

<2 carriage returns>
Person2
Address
Value1
License status.. blah...

<2 Carriage returns>
etc...

After running the text file through a SED command, i'd like the file to look like this:

Person1|Address|Value1|License Status blah blah blah
Person2|Address|Value1|License status.. blah...
Person3|etc...

Any help is greatly appreciated! Thanks in advance!

Hi, I'm not sure if it's OK with You but I would use a combination of tr and sed, because it feels natural, since You expressed the problem in two steps. First let tr replace each newline with | and then let sed replace double || with a newline, like this:

anyway I think You would still need two "passes" if using sed for both tasks.

/Lakris

Only addition I'd make is that sed's substitute command will need to look for three pipes in a row as the two intervening newlines actually represent the second and third newlines in a row.

So, you'd want
tr "\n" "|" < input.txt | sed 's/|||/\n/g'

The above code not generating any output.Could you please suggest me ?

Thanks in advance

The code snippets above worked flawlessly! Thanks for the tips. Cant tell you how much time it saved me! I love my HP notebook running openSUSE 11!

Cheers,
RogCor