删除特定的字符行


-2

我想删除所有以alter table ........ 开头并以...结尾的行; 在我的文件中有几个alter table ........语句

create table EMPLOYEE
(
  EMP_ID   NUMBER not null,
  D_ID NUMBER,
  P_ID     NUMBER,
  EMP_DESC VARCHAR2(2000)
)
tablespace USERS
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
  );



alter table  CALL_OCCURED
  add unique (HIS_ID)
  using index 
  tablespace USERS
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
  );


create table DEPARTMENT
(

  D_ID         NUMBER(11) not null,
  CLI             VARCHAR2(45),
  DNS             VARCHAR2(20),
  ATED_DATE    DATE,
  START_TIME DATE,
  END_TIME   DATE,
  LAT             VARCHAR2(45),
  LON             VARCHAR2(45),
  MSN      VARCHAR2(45),

)
tablespace USERS
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
  );

您可以使用查找/替换,但只是删除您不想要的行更快。
DavidPostill

Answers:


2

我想删除所有以“alter table”开头并以“;”结尾的行

  • 菜单“搜索”>“替换”(或CtrlH

  • 设置“查找内容” alter table.*?;

  • 将“替换为”设置为空字符串

  • 启用“正则表达式”

  • 启用“匹配换行符”

  • 点击“全部替换”

    在此输入图像描述


进一步阅读

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.