How to append a pattern to the previous line?
Hello everyone,
I have a file like this Code:
$`c1` Code:
$`c1` [1] "test1" [2] "test2" [3] "test3" Thanks |
Quote:
In Perl, you could do this: Code:
perl -ne 'BEGIN {$f = 0}; chomp; print "\n" if (/^[^[]/ and $f); print "$_ "; $f = 1; END {print "\n"}' filename Code:
perl -ne 'chomp; print "\n" if (/^[^[]/); print "$_ "; END {print "\n"}' filename |
Thank you, that solved the problem
|
All times are GMT -5. The time now is 06:03 PM. |