Need help please

Michael Smith smithm at netapps.com.au
Wed Jul 29 14:21:19 CEST 2009


On Wed, 29 Jul 2009 05:03:50 -0700 (PDT)
marvin carandang <marvin_ee2006 at yahoo.com> wrote:

> Hello Nedit Experts,
> 
> I have a long list of digital pattern and would like to delete certain groups of texts in between. I attached a snap-shot below. ( I just changed the content due to confidentiality reasons):
> 
> ------------------------------------------------------------------
> Page 1 abcdefassdsd,msdskdskskds
> njsdsdjskd 
> ...
> ...
> ..
> ....
> .....
>                                                                                                                                  Example
>       < Digital Data>
> 
> Page 2 abcdefassdsd,msdskdskskds
> njsdsdjskd 
> ...
> ...
> ..
> ....
> .....
>                                                                                                                                  Example      
>     <Digital Data>
> 
> ...and so on....
> -------------------------------------------------------
> 
> 
> I want to delete all characters starting from the "space" after the page number until the word "Example". I short, I need the resulting data to be like this:
> ------------------------------------
> Page 1
> 
>         < Digital Data>
> 
> Page 2
> 
>        < Digital Data>
> 
> Page 3
> 
> ... and so on
> --------------------------------------
> This is thousands of pages long but the pattern is just the same. How do I do that? Thanks for the help!!!
> 
> //electron
> 
> 
>       

Better to write an awk program. 

/^Page.*$/ {
    skip=1
}

/^.*Example.*$/ {
    skip=0
}

{
    if(skip != 0)
    {
        print
    }
}


This is just an indication of what you can do. It won't work properly up front. If you can send me some actual data I might be able to do a better job with 10 minutes of hacking or so.
-- 
Michael Smith
Network Applications
www.netapps.com.au   | +61 (0) 416 062 898
Web Hosting          | Internet Services
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.nedit.org/pipermail/discuss/attachments/20090729/8d674807/signature.bin


More information about the Discuss mailing list