|
Re: New tool for textutils: msg#00112gnu.core-utils.bugs
Antonio Diaz <ant_diaz@xxxxxxxxxxx> wrote: > Recently i needed a tool for removing from a text file the lines Thank you! However, I'm not sure it's worthwhile to write such a program in C when it can be done so concisely e.g., with Perl (for N=100): > -M, --max-length=<n> remove lines longer than <n> perl -ne 'my $x = $_; chomp; length > 100 or print $x' perl -ne 'my $x = $_; chomp; print $x if length <= 100' > -m, --min-length=<n> remove lines shorter than <n> perl -ne 'my $x = $_; chomp; length < 100 or print $x' perl -ne 'my $x = $_; chomp; print $x if length >= 100' I readily admit that we can't expect everyone to use Perl, but for simple things like this, adding a few examples to the manual might be appropriate. However, there must already be good collections of useful Perl one-liners, so maybe a pointer to such a collection would be better. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | New tool for textutils: 00112, Antonio Diaz |
|---|---|
| Next by Date: | Re: New tool for textutils: 00112, Antonio Diaz |
| Previous by Thread: | New tool for textutilsi: 00112, Antonio Diaz |
| Next by Thread: | Re: New tool for textutils: 00112, Antonio Diaz |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |