I have a text file like this...
$index 57320
$title The vertex-cover polynomial of a graph
$time 1988
$abstract In this paper we define the vertex-cover...
$index 57321
$title Locating stations on rapid transit lines
$time 1978
$index 57322
$title Fast heuristics for large scale covering-location problems
$time 1998
$abstract We propose fast heuristics for large scale...
$index 57323
$title Efficient vector processing on dataflow supercomputer SIGMA-1
$time 2001
$abstract Efficiency in vector handling is the key to obtaining high...
I want to convert each linebreak
into comma
and in the same time each emptyline
to linebreak
. Whereas the output for example text should be like this(text shortened using "dots"...):
$index 57320,$title The vertex-cover...,$time 1988,$abstract In this paper...
$index 57321,$title Locating stations on...,$time 1978
$index 57322,$title Fast heuristics for...,$time 1998,$abstract We propose fast...
$index 57323,$title Efficient vector...,$time 2001,$abstract Efficiency in...
I tried \r\n
replaced with ,
and it works but how to simultaneously apply both operations for converting linebreaks
to comma
and emptyline
to be used as linebreaks
for obtaining the desired output.
Please help in this regard.
Thanks!