Need help with a special sorting of files in folders

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Lillekarl
Junior Member
Junior Member
Posts: 2
Joined: 2022-01-07, 10:20 UTC

Need help with a special sorting of files in folders

Post by *Lillekarl »

Hi!

Very new to total commander, I tried to YT my answer first but could not find it there or in the FAQ.

So I process a lot of files using different software and usually I have the original files in folders with the naming xxx_yyy_20210101_001, xxx_yyy_20210101_002, xxx_yyy_20210101_0003, xxx_yyy_20210101_004, xxx_yyy_20210101_005, and so on. Inside these folders there are a lot of files. When running a batch process it's easier to just cut all of these files and place them one level above so that they are all together. But once processed I need to manually place them back in corresponding folders again... With total commander I learned how to copy the folder structure but need help with how to automatically sort back the files. Like a sync and sort by folder function, is there a way to do this?

Thanks from Sweden / Mr Larsson!
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Need help with a special sorting of files in folders

Post by *nsp »

The best if you have to move your files from a "root" folder to sub folders is to use the multi rename tool.
(if you can easily recover target folder name from file name) we can probably help to write the command. if you give the scheme to get target from current filename...
let say you have file named xxx_yyy_20210106_001#name.ext and you want xxx_yyy_20210106_001\name.ext as result, you can use regexp or fixed place to cut inside name [N1,20]\[N22-] (you even do not need to create folder structure before)
Lillekarl
Junior Member
Junior Member
Posts: 2
Joined: 2022-01-07, 10:20 UTC

Re: Need help with a special sorting of files in folders

Post by *Lillekarl »

Tyvm for help!

I will give it a try using the naming tool come Monday, with your suggestions =)

I have a folder structure that looks like this:
C:\...\projectfolder\Projectname_Client_Area_Block_001
C:\...\projectfolder\Projectname_Client_Area_Block_002
..etc

In each of these folders there is a number of files:
0000_Date_Timestamp_name.ext
0001_Date_Timestamp_name.ext
0003_Date_Timestamp_name.ext
etc

These end up in C:\...\projectfolder after the processing with a new prefix, which is easily renamed to match the original file.
Processed_0000_Date_Timestamp_name.ext
Post Reply