Re: grep prolem
From: Heiner Steven (heiner.steven_at_nexgo.de)
Date: 10/20/03
- Next message: rakesh sharma: "Re: How to parse this txt file?"
- Previous message: Heiner Steven: "Re: Shell Script Help?"
- In reply to: Eric Moors: "Re: grep prolem"
- Next in thread: Lalit: "Re: grep prolem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 20 Oct 2003 23:55:33 +0200
Eric Moors wrote:
>>In the above lines i want to pick up the lines whereever 'DISK FILE'
>>starts and upto
>>the point 'END OF SEARCH'.
>>All the lines comes in the DISK FILE' and 'END OF SEARCH' keywords ?
>
> I know you asked for grep, but sed is just perfect for this:
>
> sed '/DISK FILE/,/END OF SEARCH/!d' xyz
and the almost identical AWK solution looks like this:
awk '/DISK FILE/,/END OF SEARCH/' xyz
Heiner
-- ___ _ / __| |_ _____ _____ _ _ Heiner STEVEN <heiner.steven@nexgo.de> \__ \ _/ -_) V / -_) ' \ Shell Script Programmers: visit |___/\__\___|\_/\___|_||_| http://www.shelldorado.com/
- Next message: rakesh sharma: "Re: How to parse this txt file?"
- Previous message: Heiner Steven: "Re: Shell Script Help?"
- In reply to: Eric Moors: "Re: grep prolem"
- Next in thread: Lalit: "Re: grep prolem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]