0

Is there any way to find and replace text string automatically in all folder's files? similar to what we get in sublime text, VS code etc

Kaushik J
  • 962
  • 7
  • 17

2 Answers2

1

In JupyterLab you can open a terminal. Depending on the OS you use, you can use the tools from that OS to do the job. On Linux for example you can use find and sed to replace:

find path/to/folder -type f -exec sed -i 's/replace this/with this/g' {} \;

Other than that I do not think that this is a built-in functionality in JupyterLab.

Michael Kopp
  • 1,571
  • 12
  • 17
1

You can install jupyterlab-search-replace extension, for example with pip:

pip install jupyterlab-search-replace

and the required ripgrep, for example on Ubuntu:

sudo apt-get install ripgrep

If you use a conda environment you can just install both with:

conda install -c conda-forge jupyterlab-search-replace ripgrep

For up-to-date installation instructions see the GitHub repository of the extension.

This extension requires JupyterLab 3 or newer.

Demonstration

krassowski
  • 13,598
  • 4
  • 60
  • 92