Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to change some characters at the same time in Vscode?

i have Vscode and Anaconda.

There are 50+ ipynb tutorial files that i studied. I work with cells.
These files have some Turkih characters that i want to change.
These characters are both in uppercase and lowercase.

Ç --> C
Ğ --> G
Ö --> O
Ş --> S
Ü --> U
İ --> I

ç --> c
ğ --> g
ö --> o
ş --> s
ü --> u    
ı --> i

In Vscode there are replace function.
How can i change all these characters at the same time for a ipynb file or for all ipynb files

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Thanks very much.

>Solution :

use the extension Replace Rules

Add the following to your settings:

  "replacerules.rules": {
    "Replace Turkih": {
      "find": ["Ç", "Ğ", "Ö", "Ş", "Ü", "İ", "ç", "ğ", "ö", "ş", "ü", "ı"],
      "replace": ["C", "G", "O", "S", "U", "I", "c", "g", "o", "s", "u", "i"]
    }
  }
  1. Open the file
  2. Execute the command: Replace Rule: Run Rule…
  3. Select the Replace Turkih rule.

With extension Command on All Files you can apply a command on a selection of files in the workspace.

We need the extension multi-command because the have to add arguments to the command.

Add the following to your settings:

  "multiCommand.commands": [
    {
      "command": "multiCommand.replaceTurkih",
      "sequence": [
        { "command": "replacerules.runRule",
          "args": { "ruleName": "Replace Turkih" }
        }
      ]
    }
  ],
  "commandOnAllFiles.commands": {
    "Add Hello to the End": {
      "command": "multiCommand.replaceTurkih",
      "includeFileExtensions": [".ipynb"]
    }
  }
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading