I have the a text on this template :
In 1935 he was asked to document the principal dancers and productions and
George newly .
he continued to shoot fashion
Bergdorf Goodman and Saks Fifth
started a series of photographs .
and want to convert every paragraph to one line seprated by “\n” i.e the output will be:
In 1935 he was asked to document the principal dancers and productions George newly .
he continued to shoot fashion Bergdorf Goodman and Saks Fifth started a series of photographs .
how can i format such thing with perl could someone provide an example ?
I tried to use Text::Wrap like below but get unwanted results
$Text::Wrap::separator=' ';
my $text=fill("","",$text);
For a one-liner, you might try something like this:
-00will set the input record separator$/to""and activate paragraph mode.-lwill set output record separator$\to"\n\n"(in this case).In script version: