Re: Q for Unix guru's

From: Alan Connor (xxxxxx_at_xxxx.xxx)
Date: 07/27/03


Date: Sun, 27 Jul 2003 02:28:21 GMT

On Sun, 27 Jul 2003 01:12:56 +0000 (UTC), Charles Demas <demas@TheWorld.com> wrote:
>
>
> In article <kNCUa.848$Bg.427@newsread4.news.pas.earthlink.net>,
> Alan Connor <alanconnor@earthlink.net> wrote:
>>On Sat, 26 Jul 2003 19:42:10 +0000 (UTC), Charles Demas
>><demas@TheWorld.com> wrote:
>>>
>>>
>>> In article <594f6d6f.0307261059.17f0ceb9@posting.google.com>,
>>> Spider-X <yedilw@yahoo.com> wrote:
>>>>what combination of grep sed cat and wc would I have to use to count
>>>>the number of lines in a file that exceed 50 characters?
>>>
>>> grep and wc
>>>
>>>>If this is
>>>>easy enough, then how do I print all the lines that exceed this limit
>>>>to its own file?
>>>
>>> awk 'length > 50' infile > outfile
>>>
>>> This sounds so much like homework!
>>>
>>>
>>> Chuck Demas
>>>
>>
>>Doesn't it....
>>
>>
>>sed -n '/................................................../p' infile > outfile
>>
>>Looks silly, but works great. Less resources and faster than awk too :-)
>>
>
> sed -n '/.\{51\}/p' infile > outfile
>
> is less silly looking but this is shorter:
>
> grep '.\{51\}' infile > outfile
>
> but that would be doing the homework for him. :-(
>
>
> Chuck Demas
>
>
>

Nice. THAT'S what I was wracking my brains to remember...The sed one...

Alan

-- 
       For Linux/Bash users: Eliminate spam from your life
       with the Mailbox-Sentry-Program. See the thread
       MSP on comp.mail.misc. 
     


Relevant Pages

  • Re: Ron de Bruins copy5 code amendment
    ... exhausted what brains I have. ... > Hi Ron, ... >> regards, Alan ...
    (microsoft.public.excel.programming)
  • Re: Playing ( crit)
    ... It still strikes me that she should have thought a bit harder before ... she?d said brightly in the tone of voice reserved for small ... wracking my brains for something to say when my turn came. ...
    (rec.arts.sf.composition)
  • Problem of combinatorics
    ... I am wracking my brains about a problem of combinatorics, ... There is a sports team of 21 people. ...
    (sci.math)
  • RE: My entire Excel worksheet scrolls down when I hit the enter key. .
    ... I have been wracking my brains out trying to remember how I cleared this up ... "Miz Nettie" wrote: ... > down in the column should be selected; instead the original cell remains ...
    (microsoft.public.excel.programming)
  • C# Function question
    ... have been wracking my brains to no avail. ... the line: string b = GetStuff(); ...
    (microsoft.public.dotnet.languages.csharp)