Hello I need to create folder based on a filename and in this folder create another one and then move file to this second folder
example:
my_file.jpg
create folder my_file
create folder picture
move my_file.jpg to picture
I have this script but it only works on windows and now I'm using Linux
for %%A in (*.jpg) do mkdir "%%~nA/picture" & move "%%A" "%%~nA/picture"
pause
Sorry if I'm not precise but English is not my native language.
Try the following:
${f%.jpg}
extracts the part of the filename before the.jpg
to create the directory. Then the file is moved there.Use
basename
to create the directory name,mkdir
to create the folder, andmv
the file: