Menu

Syntax Error because of "

Help
Robert
2021-12-24
2021-12-24
  • Robert

    Robert - 2021-12-24

    I need to run this find / replace in a huge json file.

    editor.replace(""duration":300", ""duration":315360000")
    editor.replace(""duration":600", ""duration":315360000")
    editor.replace(""duration":900", ""duration":315360000")
    editor.replace(""duration":3600", ""duration":315360000")

    I get the following error im sure its the " s in the syntax

    SyntaxError: invalid syntax
    File "C:\Program Files\Notepad++\plugins\PythonScript\scripts\User\Mods.py", line 7
    editor.replace(""duration":300", ""duration":315360000")

    Thanks for your help.

     
  • Sasumner

    Sasumner - 2021-12-24

    Try it this way:

    editor.replace('"duration":300', '"duration":315360000')

     

Log in to post a comment.