in reply to Remove SOME new lines
Hi RenMcCourtey,
Is this what you're looking for?
$ cat in.txt AaX ObU UcU XdR ZeZ UfH UgU FhA OiG UjX UkZ UlZ xmT $ perl -pe 'chomp if /^U/' in.txt AaX ObU UcUXdR ZeZ UfHUgUFhA OiG UjXUkZUlZxmT
Update: Explanation: When using the -p switch without the -l switch (perlrun), each line read into $_ still contains the newline, which is normally output when the lines are printed back out. So the chomp just chops the newline off, and those lines are printed without the final newline.
Hope this helps,
-- Hauke D
|
|---|