Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Delete Empty Lines

happy10319Jun 6 2019 — edited Jun 7 2019

Hi,

I have a file with empty lines.

The content is :

John Smith   66888:john@smith.example.fr

Timn Kith: 76321:timn@kith.example.com

PAUL KIKHTY: 54432:paul@kity.com

Then I run:

sed '/^$/d' myfile.txt

Output is

John Smith   66888:john@smith.example.fr

Timn Kith: 76321:timn@kith.example.com

PAUL KIKHTY: 54432:paul@kity.com

then I run

$ more myfile.txt

John Smith   66888:john@smith.example.fr

Timn Kith: 76321:timn@kith.example.com

PAUL KIKHTY: 54432:paul@kity.com

As you can see the empty line is not deleted. What is wrong with my sed command?

Thanks.

This post has been answered by Andris Perkons-Oracle on Jun 6 2019
Jump to Answer

Comments

Post Details

Added on Jun 6 2019
8 comments
549 views