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

John O'Toole
Hi,

The sdo_gtype of your sample geometry is 3002 which suggests you are storing x, y, z values. i.e. heights in the z.
Based on your explanation of the data, it sounds like you should be using Linear Referencing - read about it here (
http://docs.oracle.com/cd/E11882_01/appdev.112/e11830/sdo_lrs_concepts.htm#BABIIFFH).
Note that use of Linear Referencing requires an Oracle Spatial license - Locator is not enough.

SDO_LRS has a variety of functions/operators which will help you achieve your goal.
E.g. SDO_LRS.LOCATE_PT
http://docs.oracle.com/cd/E11882_01/appdev.112/e11830/sdo_lrs_ref.htm#i85478

John
1013173
Hi,

Thanks for the tip.
I used the LOCATE_PT function with the SDO_UTIL.GETVERTICES function and it works.

My query is (for hisghway id = '1000' and km = 5000):

select li.*, t.*
from HIGHWAYS li , table( sdo_util.getvertices( SDO_LRS.LOCATE_PT( li.geom, 5000 ) )) t
where li.id = '1000'
;
1 - 2

Post Details

Added on Jun 6 2019
8 comments
560 views