replace a string to new Line

replace a string to new Line

經常用vi搜尋與取代的功能 但是常常卡在 當我要將xxx取代成換行 ex: axbxcxd 換成 a b c d 就在vi這樣下 1,\$s/x/\^M/g 比較需要注意的是 \^M 不是 shift+6 shift+m 而是 ctrl+v ctrl+m Computing.Net - replace a string to new Line The following expression is in one line 'AN- EIP04398375704| TI- Convergence and dissemination: A brief history and description of the StreamNet Project| AU- Oftedahl, Lenora A.|' I want replace 'TI-' to a new line with 'TI: ' like AN- EIP04398375704| TI- Convergence and dissemination: A brief history and description of the StreamNet Project| AU- Oftedahl, Lenora A.| What command to be used in VI,Sed, tr etc to change in above said format. if you can open the file in vi use following :%s/ TI/\^MTI Note to get \^M use following Hold down the Ctrl, and press v m DO NOT USE Shift+6 and Shift+M"

convert from Thomas blog post id 30 old convert log: ./144900/tag%3E2006%2011%20linux)

@2006 @11 @linux

Comments