in reply to Remove newlines and join lines
Here is a way that I used to solve your problem (be careful about the number of newlines and alike. It is a very fragile approach)
#!/usr/bin/perl -w use strict; my $a = join '', <DATA>; $a =~ s/\n{2}(\d.\d+)/ $1/g; $a =~ s/\n{2}/\n/g; print $a; __DATA__ Alan 2.13 Mary 2.16
This prints:
Alan 2.13 Mary 2.16
I hope this is of any use.
|
---|
In Section
Seekers of Perl Wisdom