* Eddine [2007.03.27 09:45]:
> ENTRY
> 
> 184
> 185  
> *----------------------------------------------------------------------------------------*;
> 186  *   PGMs Complexes               1 : enable - O : disable
>                       *;
> 187  
> *----------------------------------------------------------------------------------------*;123
> 
> 188
> 189       %include "&pgm.MainComplex.sas"    ; ** Macro principale
> Base et Queries **;
> NOTE: %INCLUDE (level 1) file E:\IFM
>      2005-01\gravure_2007_03_15\BRD_04-11-J\Database\Programs\MainComplex.sas
> is file E:\IFM
>      2005-01\gravure_2007_03_15\BRD_04-11-J\Database\Programs\MainComplex.sas.
> 
> 269 
> +*----------------------------------------------------------------------------------------*;
> MPRINT(MAINCOMPLEX):
> *----------------------------------------------------------------------------------------*;
> 
> RESULT :
> 
> NOTE: %INCLUDE (level 1) file E:\IFM
>      2005-01\gravure_2007_03_15\BRD_04-11-J\Database\Programs\MainComplex.sas
> is file E:\IFM
>      2005-01\gravure_2007_03_15\BRD_04-11-J\Database\Programs\MainComplex.sas.
> 
> *----------------------------------------------------------------------------------------*;
> 
> (for a try :%s/^[0-9]*/TEST/ didn't work).

You are close. The problem is that this pattern
will match *every* line, since you accept "zero or
more" digits at the beginning of the line.

Try:

:%s/^[0-9]\+/TEST/

Using \+ instead of * in the pattern will match
"one or more" instead of "zero or more".

Then to also match lines that begin with MPRINT:

:%s/^\([0-9]\+\|MPRINT\)/TEST/

Then to delete them (make sure you undo the
previous substitution...):

:g/^\([0-9]\+\|MPRINT\)/d

HTH,

-- 
JR

Reply via email to