HI, thanks for coming back to me..i noticed that your suggested command does not filter out on the lines starting with a,b,c? which is what i need it to do?
cheers
Sat
% means "in the whole file" ... just a lazy typing for 1,$
but the substitution will occure only in the lines matching the pattern defined between the first / / since this pattern match the whole line that start with a,b,c you can then use & to refer to that match before you add the expected x this avoid \( \) \1 grouping stuff