0
I need to rename over a thousand files with the . bmp extension located in a "screen" directory".
The files to be renamed follow this logic "2017-08-06 19-29-58.bmp", "2017-08-06 19-29-59.bmp", "2017-08-06 19-30-00.bmp"... according to their creation datum.
I already have a name for each of these files, but the new names do not follow a sequence, for example: the file "2017-08-06 19-29-58.bmp" will be called "White Set.bmp", the following file "2017-08-06 19-29-59.bmp" will be renamed to "Black Set.bmp"the next file "2017-08-06 19-30-00.bmp" will become "Red Set.bmp" and so on.
I don’t know how to specify through PHP code so that the web page checks all the files listed in the directory "screen" and renames them according to my list of already defined names (array).
If you will have to manually set all the file names, it is not easier to rename them directly?
– Woss
It is that I can define the names through Excel, some parts of the name will be fixed. Whenever I have to rename a new batch, I will only need to exchange a word, using the mentioned example, I would exchange "Set" for "Pieces", in the future for "Parts"... but I will repeat the process many times, so it would not be good to do it manually.
– Wesley
@Isac yours I don’t know if you can see this comment, but I was able to adapt your response that was removed, and it would be the solution to my problem. Someone removed it and I can’t see it anymore.
– Wesley
@I’m the one who removed it because it apparently doesn’t match what you want. It would have to be rewritten according to its objectives, but it will have to be much more specific in them.Moreover it seems to me a solution propitiates error.
– Isac
@Isac I understand, but I can work together with this answer https://answall.com/a/108663/33945, I will take the names through PHP and insert them into Excel to sort as needed, and together with the formula Concatenate, create the full array automatically. Unfortunately you removed the answer before I could copy the code passed :(
– Wesley
@Wesley I put the answer back so I can see the code I had, and I also took the opportunity to add the logic I think I was looking for.
– Isac