cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to go up two folders using relative path in %run?

cmilligan
Contributor II

I'm wanting to store a notebook with functions two folders up from the current notebook. I know that I can start the path with ../ to go up one folder but when I've tried .../ it won't go up two folders. Is there a way to do this?

1 ACCEPTED SOLUTION

Accepted Solutions

UmaMahesh1
Honored Contributor III

Hi @Coleman Milligan​ 

Please try ../../notebook

If you need to go more levels you need to add ../

It is standard dox notations.

Basically

./notebook - same directory relative path

../notebook - one directory above your current directory

../../notebook - 2 directories above your current directory

../../../notebook - 3 directories up and so on......

Hope this helps

Cheers...

Uma Mahesh D

View solution in original post

2 REPLIES 2

UmaMahesh1
Honored Contributor III

Hi @Coleman Milligan​ 

Please try ../../notebook

If you need to go more levels you need to add ../

It is standard dox notations.

Basically

./notebook - same directory relative path

../notebook - one directory above your current directory

../../notebook - 2 directories above your current directory

../../../notebook - 3 directories up and so on......

Hope this helps

Cheers...

Uma Mahesh D

VaibB
Contributor

In order to access a notebook in the current folder use ../notebook_2

to go 2 folders up and access (say notebook "secret") use ../../secret

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group