Re: extracting text in bourne shell

From: John W. Krahn (krahnj_at_acm.org)
Date: 07/29/03


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


Relevant Pages

  • Re: extracting text in bourne shell
    ... > I want to write a script that exract text from data file i.e ... > % cat data ... > % extract data ...
    (comp.unix.shell)
  • Re: extracting text in bourne shell
    ... >I want to write a script that exract text from data file i.e ... >how to prgramme in awk, so if suggesting me the solution in awk please ...
    (comp.unix.shell)
  • Assistance needed with script.......
    ... have a somewhat simple script, ... I would like to parse from the data file, such as Front Director Paths, ... Device Emulation Type: FBA ... Device Defined Label Type: N/A ...
    (perl.beginners)
  • Re: Assistance needed with script.......
    ... this is the hoh structure ... >> script and the file that I am reading to gather the data. ... >> Device Capacity ... >> I would like to parse from the data file, such as Front Director Paths, ...
    (perl.beginners)
  • Re: Separation and Security
    ... Most account management processes can be handled by script commands. ... open the data file then go Define Accts.. ... This is a bit of a security loop hole since anyone with a password can ...
    (comp.databases.filemaker)