cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

How to write same code in different locations in the DB notebook?

kodvakare
New Contributor III

The old version of the notebook had this feature, where you could Ctrl+click on different positions in a notebook cell to bring the cursor there, and type to update the code in both the positions like in JupyterLab. The newer version is awesome but seems to lack this feature.

Is there any alternative way to do this?

  1. Old Databricks version, where you could simultaneously update the code in multiple positions like a Jupyter notebookOld DataBricks version, update in multiple positions like Jupyter IDE
  2. New Databricks version, can only update at a single position at once

imageThanks

1 ACCEPTED SOLUTION

Accepted Solutions

UmaMahesh1
Honored Contributor III

Hi @Ashwath Kodvakare​ 

Apologies for my previous answer. I was a bit slow in using out the experimental features...lol.

As for your issue, it is happening because you are using an experimental feature where databricks is trying to use Monaco editor, which is the same as VS code.

In this editor, instead of Ctrl+click, you have to use Alt key and click in each location to achieve what you are trying to do.

Do read the documentation for more help.

https://docs.databricks.com/notebooks/notebook-editor.html

Hope this helps. Also please don't forget to mark this as an answer if you found what you are expecting.

Cheers..

View solution in original post

5 REPLIES 5

UmaMahesh1
Honored Contributor III

Hi @Ashwath Kodvakare​ 

I guess that is not dependent on the DBR versions.

However, using all the versions available till now, I'm still able to do a multi line select.

imageBut I'm still a bit interested in why you are facing this issue. Can you please paste the entire databricks window snapshot along with the cluster configuration you are using ?

Seeing the strings in brown color is what I want to verify once. Also verify if you are able to do a multi line select in some other application.

Do let me know the above status..

Cheers...

UmaMahesh1
Honored Contributor III

Hi @Ashwath Kodvakare​ 

Apologies for my previous answer. I was a bit slow in using out the experimental features...lol.

As for your issue, it is happening because you are using an experimental feature where databricks is trying to use Monaco editor, which is the same as VS code.

In this editor, instead of Ctrl+click, you have to use Alt key and click in each location to achieve what you are trying to do.

Do read the documentation for more help.

https://docs.databricks.com/notebooks/notebook-editor.html

Hope this helps. Also please don't forget to mark this as an answer if you found what you are expecting.

Cheers..

kodvakare
New Contributor III

Hi, @Uma Maheswara Rao Desula​,

Thank you for the reply.

Alt + Click worked with the new editor. I will surely check out the Monaco editor.

SS2
Valued Contributor

I was looking for the same.. great thq​

SS2
Valued Contributor

Alt+click is working fine ​

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.