Re: Q for Unix guru's
From: Alan Connor (xxxxxx_at_xxxx.xxx)
Date: 07/27/03
- Next message: Floyd Davidson: "Re: Q: how do I open xterm, run command, and continue manual input?"
- Previous message: Alan Connor: "Re: Q: how do I open xterm, run command, and continue manual input?"
- In reply to: Charles Demas: "Re: Q for Unix guru's"
- Next in thread: Walter Briscoe: "Re: Q for Unix guru's"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: Floyd Davidson: "Re: Q: how do I open xterm, run command, and continue manual input?"
- Previous message: Alan Connor: "Re: Q: how do I open xterm, run command, and continue manual input?"
- In reply to: Charles Demas: "Re: Q for Unix guru's"
- Next in thread: Walter Briscoe: "Re: Q for Unix guru's"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|