kabucek Posted April 24, 2009 Share Posted April 24, 2009 hello, I have the large file (textfile) there are word: code-007100 ... code-007199 How to substitute those all words(using vi editor), so it will change all instances to: code-007200 ... code-007299 Thanks Link to comment https://forums.phpfreaks.com/topic/155521-substitute-pattern-with-another-patter-in-vi/ Share on other sites More sharing options...
Maq Posted April 24, 2009 Share Posted April 24, 2009 Why are you using vi? Use vim, you caveman. %s/code-007100/code-007199/g Link to comment https://forums.phpfreaks.com/topic/155521-substitute-pattern-with-another-patter-in-vi/#findComment-818405 Share on other sites More sharing options...
kabucek Posted April 24, 2009 Author Share Posted April 24, 2009 in fact i'm using vim, because in cygwin there is vim not vi . I'm lazy and I got used to vi name what if I have: ..01 ..25 and want to have ..26 ..50 ? thanks Link to comment https://forums.phpfreaks.com/topic/155521-substitute-pattern-with-another-patter-in-vi/#findComment-818412 Share on other sites More sharing options...
Maq Posted April 24, 2009 Share Posted April 24, 2009 I don't understand what the pattern is there.... Link to comment https://forums.phpfreaks.com/topic/155521-substitute-pattern-with-another-patter-in-vi/#findComment-818426 Share on other sites More sharing options...
kabucek Posted April 24, 2009 Author Share Posted April 24, 2009 code-007100 .. code-007125 and I wanted to be code-007126 .. code-007150 Link to comment https://forums.phpfreaks.com/topic/155521-substitute-pattern-with-another-patter-in-vi/#findComment-818427 Share on other sites More sharing options...
Daniel0 Posted April 25, 2009 Share Posted April 25, 2009 [iurl=http://www.phpfreaks.com/forums/index.php/topic,249473.0.html]Duplicate[/iurl]. Locked. Link to comment https://forums.phpfreaks.com/topic/155521-substitute-pattern-with-another-patter-in-vi/#findComment-818926 Share on other sites More sharing options...
Recommended Posts