Need help please

intertwingled intertwingled at qwest.net
Wed Jul 29 15:57:47 CEST 2009


Better to do it in Perl!

Michael Smith wrote:
> 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.
> 

-- 
I always have coffee when I watch radar!


More information about the Discuss mailing list