diff --git a/replace_text.py b/replace_text.py index 37504e7a39c3537771f8fd0b925973683c7fe358..2002089152516b5a4f7875cfe3082eeb42263861 100644 --- a/replace_text.py +++ b/replace_text.py @@ -10,8 +10,9 @@ import glob import os # Input and output text files -pathSource = "./config_files/" -pathDest = "./config_files_new/" +pathSource = "./runs/seed=181612_enssize=20_EAKF_6hrs/" +pathDest = "./runs/seed=181612_enssize=20_EAKF_6hrs/" +#pathDest = "./backup/config_files_new/" textFiles_Source = glob.glob(pathSource+"*.json") textFiles_Dest = [i.replace(pathSource,pathDest) for i in textFiles_Source] @@ -19,8 +20,8 @@ if not os.path.exists(pathDest): os.makedirs(pathDest) # searched text and replacement text -search_text = '"nens": 20' -replace_text = '"nens": 200' +search_text = '"nature_run_from_file": "./runs/seed=181612_enssize=20_EAKF_6hrs//exp_A.pickle",' +replace_text = '"nature_run_from_file": "./runs/seed=181612_enssize=20_EAKF_6hrs//exp_A1.pickle",' # Loop over each text file in our list from above for source,dest in zip(textFiles_Source,textFiles_Dest): @@ -43,4 +44,4 @@ for source,dest in zip(textFiles_Source,textFiles_Dest): # Writing the replaced data in our # text file - file.write(data) + file.write(data) \ No newline at end of file