dbv file=/sja7/appl/oracle/ship/system01.dbf feedback=100 logfile=./.log
blocksize=8192
dbv file=/sja8/appl/oracle/ship/undotbs.dbf feedback=100 logfile=./.log
blocksize=8192
dbv file=/sja7/appl/oracle/ship/tools.dbf feedback=100 logfile=./.log
blocksize=8192
dbv file=/sja7/appl/oracle/ship/dtuser_01.dbf feedback=100 logfile=./.log
blocksize=8192
......
how can I change it to like bleow by using one command line
dbv file=/sja7/appl/oracle/ship/system01.dbf feedback=100
logfile=./system01.log blocksize=8192
dbv file=/sja8/appl/oracle/ship/undotbs.dbf feedback=100
logfile=./undotbs.log blocksize=8192
dbv file=/sja7/appl/oracle/ship/tools.dbf feedback=100 logfile=./tools.log
blocksize=8192
dbv file=/sja7/appl/oracle/ship/dtuser_01.dbf feedback=100
logfile=./dtuser_01.log blocksize=8192
.............
Thank you very much
Jerry
--
View this message in context: http://www.nabble.com/How-to-do-this--tp20627275p20627275.html
Sent from the Vim - General mailing list archive at Nabble.com.
This should be pretty easy to accomplish with a simple regex. Something
like
%s#^\(dbv file=/sja./appl/oracle/ship/\)\(.\+\)\(.dbf .*logfile=\)[^
]*#\1\2\3./\2.log#
Bill
In all versions of Vim, you _match_ a line break with \n in the first
half of a :subst command, you _insert_ one with \r in the second half.
This means that one silly way to count lines (by replacing line breaks
with themselves) is
:%s/\n/\r/
Best regards,
--
The Heineken Uncertainty Principle:
You can never be sure how many beers you had last night.
While regular expressions can do wonders, here is yet
another way to solve your problem using VimL:
let line = 1
while line < line('$')
let fline = split(getline(line))[:2]
let logfile = fnamemodify(fline[1], ":t:r")
call setline(line, join(fline))
call setline((line + 1), 'logfile=./'.logfile.'.log '.getline((line + 1)))
let line += 2
endwhile
Regards,
Ag.