I have many files like the following:
cat test.data
name1
...
nameN
title1
...
titleM
abstract1
...
abstractO
ID
where the numbers N,M,O differ from file to file. But in all files the fields are separated by empty lines. I want to transform these data into csv, each file into a line with the rows (name, title, abtract, ID) like this:
name1 ...nameN|title1 ... titleM|abstract1 ... abstractO|ID
I have tried with awk and sed, but failed. Any suggestions would be helpful. Thanks in advance.