I have a list of numpy files in one folder, I try to modify the name of each file in my folder 3_Traces_npy
from this format:
AES_Trace=1234_key=000102030405060708090a0b0c0d0e0f_Plaintext=f9f19b259648feb20d842480745de16f_Ciphertext=a3140be40735f9f1865aa6b1b32b5667.npy
to this format:
dataArray1234_pti_f9f19b259648feb20d842480745de16f_cypher_a3140be40735f9f1865aa6b1b32b5667.npy
This is may code, where I am blocked how to create the nw name:
import os
path_For_Numpy_Files='C:\\Users\\user\\3_Traces_npy'
os.chdir(path_For_Numpy_Files)
list_files_Without_Sort=os.listdir(os.getcwd())
list_files_Sorted=sorted((list_files_Without_Sort),key=os.path.getmtime)
for file in list_files_Sorted:
new_name=
os.rename(os.path.join(path_For_Numpy_Files, file), os.path.join(path_For_Numpy_Files, new_name))