Rename files

I have folders labeled A1, A2, A3… and inside each folder is a file 001_GFP or 001_mCherry. I have had success in loading these images and running the analysis but I would like the output with my counts to match the folder name.


You posted in the Cellprofiler 1.0 forum on new modules. Are you really using CP1 (which is not being developed any more), or the current CP2? It may change our answer.

In general you need to strip “metadata” from your folder path and add this to your output. In CP1 you can do this with FilenameMetadata and with CP2 you can do this within LoadImages using the “Group images by metadata” selection box and then use regular expressions to define your metadata, like “Plate”. Then in your export module you can define a custom output directory (in ExportToSpreadsheet change the Output file location to “Default output Folder sub-folder”) and right-click to insert “Plate” metadata. Give this a try and let us know how it goes. Once you get it setup it is quite powerful, not just for saving images/data, but also in performing analyses by various grouping parameters.


Thank you! It is now doing exactly what I need.

Great – glad that helped.