Eg qq Then do it for one line q to stop recording
@q or @@ (repeating action) to apply your commands to all files
a-2) Use find-replace with back references:
:%s/\([^\t]\)*\t\([^\t]*\)/INSERT INTO X VALUES ("\1","\2")/
where \( .. \) captures text * = repeats eating text
\1 \2 is replaced by text captured by \( \)
and \t is is assumed beeing the CSV separator of fields
b) Most database systems can import CSV, use that way
c) write a VimL script which parser .csv and creates the queries.
d) Many guis let you read .csv and import them into dbs.
Marc Weber
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment