Hello, Buddies,
I must use Unix vim editor to edit a very large xxx.sql file. I have the
following urgent sytax question, I wonder if any friend can help me a
liittle....
(I just bought a vim book, however, I am still not good enough..  )

1. I have a lot of lines with break like below:
ALTER TABLE "HCDCNV"."SUBLEDGER_ENTRY" ENABLE CONSTRAINT 
"SUBLEDGER_ENRTY_FK5" ;
...
(how can I change it to )
ALTER TABLE "HCDCNV"."SUBLEDGER_ENTRY" ENABLE CONSTRAINT
"SUBLEDGER_ENRTY_FK5" ; ---no break for each line in the whole file.
(and a liitle more...
 if I can merge all the lines into one line before ';' in whole file? How?


2.I just want to extrat those 'ALTER TABLE ...ENABLE CONSTRAINT..' clause
(like below as example)in the whole xxx.sql file, and save it to new file
called '1.sql'

ALTER TABLE "HCDCNV"."SUBLEDGER_ENTRY" ENABLE CONSTRAINT
"SUBLEDGER_ENRTY_FK5" ;
ALTER TABLE "PCDCNV"."VALIDASSOCIATION" ENABLE CONSTRAINT
"FK_VALIDASSOCIATION_01";
ALTER TABLE "PCDCNV"."VALIDASSOCIATION" ENABLE CONSTRAINT
"FK_VALIDASSOCIATION_02";
.....


3. in the whole file, there are some 'CREATE TABLE....' clause, like below

CREATE TABLE "HCDCNV"."ADDR_AGREEMENT" ("AGREEMENT_ID" NUMBER,
"AGREEMENT_CODE" VARCHAR2(64) NOT NULL ENABLE, "AGREEMENT_EFF" DATE
NOT NULL ENABLE, "CRTN_DT_TMSTMP" DATE NOT NULL ENABLE, "IS_VALID"
VARCHAR2(1) NOT NULL ENABLE, "CRTN_LGN_ID" VARCHAR2(20) NOT NULL
ENABLE, "MDFD_DT_TMSTMP" DATE NOT NULL ENABLE, "MDFD_LGN_ID"
VARCHAR2(20) NOT NULL ENABLE) PCTFREE 10 PCTUSED 80 INITRANS 1
MAXTRANS 255 STORAGE(INITIAL 1048576 FREELISTS 1 FREELIST GROUPS 1)
TABLESPACE "CONVTABLES" LOGGING NOCOMPRESS ;

so how can I extract only those 'CREATE TABLE....' clause till ';' from this
file and save it to a new file, say '2.sql'

4. 

ALTER TABLE "PCDCNV"."VALIDASSOCIATION" ADD CONSTRAINT
"FK_VALIDASSOCIATION_03" FOREIGN KEY ("OBJECTTYPEUID") REFERENCES
"OBJECTTYPE" ("OBJECTTYPEUID") ENABLE NOVALIDATE
;

How can I extract only those 'ALTER TABLE ....ADD CONSTRAINT' till ';'clause
from this file and save it as new file '3.sql';



If any friend can give me an answer, it can give me a lot help to resolve
urgent need, while I still keep learning it.


Thanks a lot in advance..

Jerry 
-- 
View this message in context: 
http://www.nabble.com/Problem-when-using-vim-sytax-to-edit-a-very-large-file%2C-please-help.-tp20286575p20286575.html
Sent from the Vim - General mailing list archive at Nabble.com.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to