Score:0

How move files into existing subfolders based on name

in flag

I have a lot of files containing a contract number and I would like to move them to the folder with the contract information. The folder also has the number in its name.

Example filename: Blanco aanvraag switch GV99999 (the GV99999 is unique)

Folder it needs to go to: DOS3403 Name1 Name2/Name 1 - 3999/5. Niet fiscale contracten/Athora/Profilife - GV99999 - 500EUR/2. Switch

The main folders f.ex. 'DOS3403 Name 1 Name2' can be in the same folder as the files that need to be moved if that is easier.

So I want a program/script/... that can lookup the contract number in the subfolders and move the corresponding file to that folder.

Thank you in advance for your help.

user535733 avatar
cn flag
I suppose you could program it. However, seems like most users will find the File Manager's "Search" feature more useful for locating common filename features and manipulating the relevant files.
waltinator avatar
it flag
Are you using Ubuntu? Which release? Can you [edit] your question and use the formatting tools to make your question readable? I can't tell which texr is part of the filename, nor what the pattern you want to use, nor what the destination directories look like.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.