+##################################################################################
+# script function: rename files in a folder
+# Dr. Rene Cejas Bolecek
+# Low Temperatures Laboratory, CAB, Argentina.
+# email: reneczechdev@gmail.com
+# licence: MIT. http://opensource.org/licenses/MIT
+##################################################################################
+rex = '*.dat*' # Define regular expresion to get the files, not sorted!
+#files.sort() # sort the list
+#print files # check sorted list
+newFilename = '10_id_' # new filename
+for f in files: # loop over the list
+ y = f.split('.dat') # Reuse some strings from the original filename
+ #print y[1] # just to check
+ intVal = int(y[1]) #transform to integer
+ shutil.move(f, newFilename+"%d" %(2*intVal+1)+".dat") #rename fn
+# {150830_iman18_10_20KTo100K_2mmHg.dat0, ..., 150830_iman18_10_20KTo100K_2mmHg.dat40}
+# {10_id_1.dat, ... , 10_id_81.dat}