Re: extracting text in bourne shell
From: John W. Krahn (krahnj_at_acm.org)
Date: 07/29/03
- Next message: Charles Demas: "Re: extracting text in bourne shell"
- Previous message: Chris F.A. Johnson: "Re: ascii to decimal conversion"
- In reply to: MIA: "extracting text in bourne shell"
- Next in thread: Charles Demas: "Re: extracting text in bourne shell"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 28 Jul 2003 22:39:06 GMT
MIA wrote:
>
> I want to write a script that exract text from data file i.e
>
> % cat data
>
> ########
> data 1 1002
> EC
> ########
> data 2 2345
> data 3 Error
> EC
> ########
> data 4 Error
> data 5 254225
> data 6 336586
> data 7 578641
> EC
> ########
>
> now I want to extract the data b/w ##### i.e.
>
> % extract data
> data 1
> EC
> data 2
> data3
> EC
> .
> .
> .
> data 7
perl -ne's/^#+$//;/\S/&&print' data
John
-- use Perl; program fulfillment
- Next message: Charles Demas: "Re: extracting text in bourne shell"
- Previous message: Chris F.A. Johnson: "Re: ascii to decimal conversion"
- In reply to: MIA: "extracting text in bourne shell"
- Next in thread: Charles Demas: "Re: extracting text in bourne shell"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|