Hello,
I have a file containing the output of an Ant script, and I'd like to strip out every line that doesn't end with a colon. For example:
Line three above is matched by the expression .*:$ but I really want to match lines four and five, so I can search-and-replace them with nothing ("").
It would make a handy feature for a future version of UltraEdit to have a "negate" check-box option in the search options dialogue, so everything that didn't match the search criteria would be found.
Similarly, it would be handy to have a "compress" feature that would eat any repeating newline characters. So if I had a file that contained two lines separated by 'x' number of sequential newline characters (blank lines), UltraEdit would remove all but one newline character, and my two lines would end up being one-after-the-other.
For now, I just use this command:
C:\> type build.log | perl -e 'while (<STDIN>){print $_ if ($_ =~ /:$/ && $_ !~ /^\s/);}'
Just some thoughts as I work through my Thursday. It may already be possible to do these things in UltraEdit, and I just don't know about it. I thought it wouldn't hurt to post them here, anyway. Best regards,
George Formby
I have a file containing the output of an Ant script, and I'd like to strip out every line that doesn't end with a colon. For example:
Code: Select all
03 > backup:
04 > [echo] Pre-install backup for 4.0.0.49 complete.
05 >
It would make a handy feature for a future version of UltraEdit to have a "negate" check-box option in the search options dialogue, so everything that didn't match the search criteria would be found.
Similarly, it would be handy to have a "compress" feature that would eat any repeating newline characters. So if I had a file that contained two lines separated by 'x' number of sequential newline characters (blank lines), UltraEdit would remove all but one newline character, and my two lines would end up being one-after-the-other.
For now, I just use this command:
C:\> type build.log | perl -e 'while (<STDIN>){print $_ if ($_ =~ /:$/ && $_ !~ /^\s/);}'
Just some thoughts as I work through my Thursday. It may already be possible to do these things in UltraEdit, and I just don't know about it. I thought it wouldn't hurt to post them here, anyway. Best regards,
George Formby