Operating System - Linux
1753809 Members
8121 Online
108805 Solutions
New Discussion юеВ

Re: replacing according to position

 
SOLVED
Go to solution
Reen
Advisor

Re: replacing according to position

Ok
But When i type in 272nd character sed function cannot be parsed error occurs.
Till 255th character,its fine.
Cant replace 256th character onwards in a line. Any suggestions?
Dennis Handly
Acclaimed Contributor

Re: replacing according to position

>Didnt get JRF`s improvement???

Instead of typing 22 "."s, you can use: .\{22\}

If you are happy with your answers, please read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
Reen
Advisor

Re: replacing according to position

But Dennis,
I cant replace 272-275th character..
Dennis Handly
Acclaimed Contributor

Re: replacing according to position

>But when i type in 272nd character sed function cannot be parsed error occurs. Till 255th character, it's fine.

Ah, that limit is documented under regexp(5).

You are going to have to do addition:
$ sed -e 's/^\(.\{200\}.\{71\}\)Blore/\1Mlore/'
Reen
Advisor

Re: replacing according to position

Hey... tats cool

thanks a lot...
got the solution!