0

Hi every one,

I have a question.

I have many files with this format:

a...a-Cb...b-d...d
a...a-b...b-Cd...d
a...a-b...b-Cd...d-e...e

so that :

1- a...a is a number with m digits,
2- b...b is a number with n digits,
3- d...d is a number with p digits,
4- e...e is a number with q digits.

and have many folder with respect to these files with this format:

"Cb...b-d...d #"
"Cd...d #"
"Cd...d-e...e #"

so that instead of # character, i have words with unicode character like this:

"C234-1 عربی"

I want a batch file, so that move by this method:

1- move files with format a...a-Cb...b-d...d to folder "Cb...b-d...d #"
2- move files with format a...a-b...b-Cd...d to folder "Cd...d #"
3- move files with format a...a-b...b-Cd...d-e...e to folder "Cd...d-e...e #"

thanks for your helps.

2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by rubberman
0

Use the 'find' command with the -exec option where you will move the qualifying files to a specific folder. Example:

find /dirname -type f -name '<pattern>' -exec mv {} /targetdir \;

This will move all files under /dirname to /targetdir. It will skip directories (using the -type f argument) and only apply the command to files.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.