Link to home
Start Free TrialLog in
Avatar of ali şahin
ali şahin

asked on

I want to delete some lines from within this file

I have a file with more rows.
I want to delete some lines from within this file.
I am using the vi editor.
I wrote a simple sentence.
but it only deletes a single line.
I have to run this code every time.This is a waste of time.
How do I delete the rows I want to delete in a lump ?

MEDULA_ESEVKTAMAM_TANI_PK,--rows I want to delete
  CREATE UNIQUE INDEX "HASTANE"."MEDULA_ESEVKTAMAM_TANI_PK" ON "HASTANE"."MEDULA_ESEVKTAMAM_TANI" ("SIRA_NO", DOSYA_NO, PROTOKOL_NO, "TEDAVI_ICD")
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE USERS,

MEDULA_ESEVKBILDIR_TANI_PK,--rows I want to delete
  CREATE UNIQUE INDEX "HASTANE"."MEDULA_ESEVKBILDIR_TANI_PK" ON "HASTANE"."MEDULA_ESEVKBILDIR_TANI" ("SIRA_NO", DOSYA_NO, PROTOKOL_NO, "SEVK_ICD")
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE USERS,

MAKBUZ_D_NO,--rows I want to delete
  CREATE INDEX "HASTANE"."MAKBUZ_D_NO" ON "HASTANE"."MAKBUZMAIN" (DOSYA_NO, PROTOKOL_NO)
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE USERS:

I wanted to write only a few because there were too many lines.

the following code works but I have to run it over and over again.
This is a waste of time.
:/^[A-Z]/d

Open in new window

Avatar of skullnobrains
skullnobrains

i'm not good with vi but this should work

sed -i.tmp -e '/^[A-Z]/ d' /path/to/file

Open in new window

You can try using Global.

:g/^[A-Z]/d
Avatar of ali şahin

ASKER

https://www.experts-exchange.com/questions/29155104/I-want-to-delete-some-lines-from-within-this-file.html?anchorAnswerId=42923498#a42923498
I've tried that before.
this code did not work.

I have windows operating system installed on my computer.

I installed the vi editor as a plugin on the pycharm(python ide)

does this create a problem?
https://www.experts-exchange.com/questions/29155104/I-want-to-delete-some-lines-from-within-this-file.html?anchorAnswerId=42923418#a42923418

I have windows operating system installed on my computer.

sed editor is not installed on my computer.

i can't run this code
sed -i.tmp -e '/^[A-Z]/ d' /path/to/file

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial