Re: Need help please

Michael Smith <[email protected]>
Newsgroups gmane.editors.nedit.user
Organization Network Applications
Message-ID <20090729222119.7ecae538@michael>
On Wed, 29 Jul 2009 05:03:50 -0700 (PDT)
marvin carandang <marvin_ee2006-/[email protected]> 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

-- 
NEdit Discuss mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/discuss
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFKcD6/b3X1SNgd/VARAvvEAJ9rue//9FlI2wipZEXORKIo+NZOTwCeNXcc
0UdZNDIqff7LZPz9/wUEyHY=
=Lsf0
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.