How to sort files into folders [closed]












-1














i need CMD / PowerShell commands? for this problem.



i have this files and i want to put him in folders



from :



user_EasonX_72090919_p1_title_伝説の花魁 ゆうぎり.jpg
user_EasonX_72176814_p0_title_ルザミーネ.jpg
user_Endsmall敏@お仕事募集_72147882_p0_title_虞美人.jpg
user_Endsmall敏@お仕事募集_72147882_p1_title_虞美人.jpg
user_Endsmall敏@お仕事募集_72147882_p2_title_虞美人.jpg
user_Endsmall敏@お仕事募集_72147882_p3_title_虞美人.jpg
user_Didi Esmeralda_74172544_p0_title_Emma Frost.jpg
user_Didi Esmeralda_74172544_p1_title_Emma Frost.jpg


to :



├───EasonX
│ user_EasonX_72090919_p1_title_伝説の花魁 ゆうぎり.jpg
│ user_EasonX_72176814_p0_title_ルザミーネ.jpg
├───Endsmall敏@お仕事募集
│ user_Endsmall敏@お仕事募集_72147882_p0_title_虞美人.jpg
│ user_Endsmall敏@お仕事募集_72147882_p1_title_虞美人.jpg
│ user_Endsmall敏@お仕事募集_72147882_p2_title_虞美人.jpg
│ user_Endsmall敏@お仕事募集_72147882_p3_title_虞美人.jpg

├───Didi Esmeralda
│ user_Didi Esmeralda_74172544_p0_title_Emma Frost.jpg
│ user_Didi Esmeralda_74172544_p1_title_Emma Frost.jpg
└───


the be start sort from (user_) to (_7)










share|improve this question













closed as too broad by Scott, fixer1234, BillP3rd, duDE, PeterH Dec 19 '18 at 10:37


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.















  • Welcome to Super User! Please note that superuser.com is not a free script/code writing service. If you tell us what you have tried so far (include the scripts/code you are already using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?.
    – DavidPostill
    Dec 19 '18 at 13:38
















-1














i need CMD / PowerShell commands? for this problem.



i have this files and i want to put him in folders



from :



user_EasonX_72090919_p1_title_伝説の花魁 ゆうぎり.jpg
user_EasonX_72176814_p0_title_ルザミーネ.jpg
user_Endsmall敏@お仕事募集_72147882_p0_title_虞美人.jpg
user_Endsmall敏@お仕事募集_72147882_p1_title_虞美人.jpg
user_Endsmall敏@お仕事募集_72147882_p2_title_虞美人.jpg
user_Endsmall敏@お仕事募集_72147882_p3_title_虞美人.jpg
user_Didi Esmeralda_74172544_p0_title_Emma Frost.jpg
user_Didi Esmeralda_74172544_p1_title_Emma Frost.jpg


to :



├───EasonX
│ user_EasonX_72090919_p1_title_伝説の花魁 ゆうぎり.jpg
│ user_EasonX_72176814_p0_title_ルザミーネ.jpg
├───Endsmall敏@お仕事募集
│ user_Endsmall敏@お仕事募集_72147882_p0_title_虞美人.jpg
│ user_Endsmall敏@お仕事募集_72147882_p1_title_虞美人.jpg
│ user_Endsmall敏@お仕事募集_72147882_p2_title_虞美人.jpg
│ user_Endsmall敏@お仕事募集_72147882_p3_title_虞美人.jpg

├───Didi Esmeralda
│ user_Didi Esmeralda_74172544_p0_title_Emma Frost.jpg
│ user_Didi Esmeralda_74172544_p1_title_Emma Frost.jpg
└───


the be start sort from (user_) to (_7)










share|improve this question













closed as too broad by Scott, fixer1234, BillP3rd, duDE, PeterH Dec 19 '18 at 10:37


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.















  • Welcome to Super User! Please note that superuser.com is not a free script/code writing service. If you tell us what you have tried so far (include the scripts/code you are already using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?.
    – DavidPostill
    Dec 19 '18 at 13:38














-1












-1








-1







i need CMD / PowerShell commands? for this problem.



i have this files and i want to put him in folders



from :



user_EasonX_72090919_p1_title_伝説の花魁 ゆうぎり.jpg
user_EasonX_72176814_p0_title_ルザミーネ.jpg
user_Endsmall敏@お仕事募集_72147882_p0_title_虞美人.jpg
user_Endsmall敏@お仕事募集_72147882_p1_title_虞美人.jpg
user_Endsmall敏@お仕事募集_72147882_p2_title_虞美人.jpg
user_Endsmall敏@お仕事募集_72147882_p3_title_虞美人.jpg
user_Didi Esmeralda_74172544_p0_title_Emma Frost.jpg
user_Didi Esmeralda_74172544_p1_title_Emma Frost.jpg


to :



├───EasonX
│ user_EasonX_72090919_p1_title_伝説の花魁 ゆうぎり.jpg
│ user_EasonX_72176814_p0_title_ルザミーネ.jpg
├───Endsmall敏@お仕事募集
│ user_Endsmall敏@お仕事募集_72147882_p0_title_虞美人.jpg
│ user_Endsmall敏@お仕事募集_72147882_p1_title_虞美人.jpg
│ user_Endsmall敏@お仕事募集_72147882_p2_title_虞美人.jpg
│ user_Endsmall敏@お仕事募集_72147882_p3_title_虞美人.jpg

├───Didi Esmeralda
│ user_Didi Esmeralda_74172544_p0_title_Emma Frost.jpg
│ user_Didi Esmeralda_74172544_p1_title_Emma Frost.jpg
└───


the be start sort from (user_) to (_7)










share|improve this question













i need CMD / PowerShell commands? for this problem.



i have this files and i want to put him in folders



from :



user_EasonX_72090919_p1_title_伝説の花魁 ゆうぎり.jpg
user_EasonX_72176814_p0_title_ルザミーネ.jpg
user_Endsmall敏@お仕事募集_72147882_p0_title_虞美人.jpg
user_Endsmall敏@お仕事募集_72147882_p1_title_虞美人.jpg
user_Endsmall敏@お仕事募集_72147882_p2_title_虞美人.jpg
user_Endsmall敏@お仕事募集_72147882_p3_title_虞美人.jpg
user_Didi Esmeralda_74172544_p0_title_Emma Frost.jpg
user_Didi Esmeralda_74172544_p1_title_Emma Frost.jpg


to :



├───EasonX
│ user_EasonX_72090919_p1_title_伝説の花魁 ゆうぎり.jpg
│ user_EasonX_72176814_p0_title_ルザミーネ.jpg
├───Endsmall敏@お仕事募集
│ user_Endsmall敏@お仕事募集_72147882_p0_title_虞美人.jpg
│ user_Endsmall敏@お仕事募集_72147882_p1_title_虞美人.jpg
│ user_Endsmall敏@お仕事募集_72147882_p2_title_虞美人.jpg
│ user_Endsmall敏@お仕事募集_72147882_p3_title_虞美人.jpg

├───Didi Esmeralda
│ user_Didi Esmeralda_74172544_p0_title_Emma Frost.jpg
│ user_Didi Esmeralda_74172544_p1_title_Emma Frost.jpg
└───


the be start sort from (user_) to (_7)







powershell cmd.exe






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 19 '18 at 1:23









ABDELRAHMAN BENGHARBI

33




33




closed as too broad by Scott, fixer1234, BillP3rd, duDE, PeterH Dec 19 '18 at 10:37


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as too broad by Scott, fixer1234, BillP3rd, duDE, PeterH Dec 19 '18 at 10:37


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • Welcome to Super User! Please note that superuser.com is not a free script/code writing service. If you tell us what you have tried so far (include the scripts/code you are already using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?.
    – DavidPostill
    Dec 19 '18 at 13:38


















  • Welcome to Super User! Please note that superuser.com is not a free script/code writing service. If you tell us what you have tried so far (include the scripts/code you are already using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?.
    – DavidPostill
    Dec 19 '18 at 13:38
















Welcome to Super User! Please note that superuser.com is not a free script/code writing service. If you tell us what you have tried so far (include the scripts/code you are already using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?.
– DavidPostill
Dec 19 '18 at 13:38




Welcome to Super User! Please note that superuser.com is not a free script/code writing service. If you tell us what you have tried so far (include the scripts/code you are already using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?.
– DavidPostill
Dec 19 '18 at 13:38










1 Answer
1






active

oldest

votes


















0














This powershell script gets the jobs done. You have to specify the target directory in the $path variable.



 $path = "d:pathtoyourdirectory"
Get-ChildItem $path -Filter "user_*" | ForEach-Object {
echo $_.Name
$folderName = $_.Name.Split("_")[1]
$newPath = Join-Path -Path $path -ChildPath $folderName
If(-not (Test-Path -Path $newPath)) {
New-Item -ItemType directory -Path $path -Name $folderName
}
Move-Item -Path $_.FullName -Destination $newPath
}


It can safely be called several times on the same target.






share|improve this answer























  • Thank you so much I've been looking for it 3 months ago You have already saved me
    – ABDELRAHMAN BENGHARBI
    Dec 19 '18 at 16:30










  • Can you also answer me on this question superuser.com/questions/1385987/…
    – ABDELRAHMAN BENGHARBI
    Dec 19 '18 at 17:38




















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














This powershell script gets the jobs done. You have to specify the target directory in the $path variable.



 $path = "d:pathtoyourdirectory"
Get-ChildItem $path -Filter "user_*" | ForEach-Object {
echo $_.Name
$folderName = $_.Name.Split("_")[1]
$newPath = Join-Path -Path $path -ChildPath $folderName
If(-not (Test-Path -Path $newPath)) {
New-Item -ItemType directory -Path $path -Name $folderName
}
Move-Item -Path $_.FullName -Destination $newPath
}


It can safely be called several times on the same target.






share|improve this answer























  • Thank you so much I've been looking for it 3 months ago You have already saved me
    – ABDELRAHMAN BENGHARBI
    Dec 19 '18 at 16:30










  • Can you also answer me on this question superuser.com/questions/1385987/…
    – ABDELRAHMAN BENGHARBI
    Dec 19 '18 at 17:38


















0














This powershell script gets the jobs done. You have to specify the target directory in the $path variable.



 $path = "d:pathtoyourdirectory"
Get-ChildItem $path -Filter "user_*" | ForEach-Object {
echo $_.Name
$folderName = $_.Name.Split("_")[1]
$newPath = Join-Path -Path $path -ChildPath $folderName
If(-not (Test-Path -Path $newPath)) {
New-Item -ItemType directory -Path $path -Name $folderName
}
Move-Item -Path $_.FullName -Destination $newPath
}


It can safely be called several times on the same target.






share|improve this answer























  • Thank you so much I've been looking for it 3 months ago You have already saved me
    – ABDELRAHMAN BENGHARBI
    Dec 19 '18 at 16:30










  • Can you also answer me on this question superuser.com/questions/1385987/…
    – ABDELRAHMAN BENGHARBI
    Dec 19 '18 at 17:38
















0












0








0






This powershell script gets the jobs done. You have to specify the target directory in the $path variable.



 $path = "d:pathtoyourdirectory"
Get-ChildItem $path -Filter "user_*" | ForEach-Object {
echo $_.Name
$folderName = $_.Name.Split("_")[1]
$newPath = Join-Path -Path $path -ChildPath $folderName
If(-not (Test-Path -Path $newPath)) {
New-Item -ItemType directory -Path $path -Name $folderName
}
Move-Item -Path $_.FullName -Destination $newPath
}


It can safely be called several times on the same target.






share|improve this answer














This powershell script gets the jobs done. You have to specify the target directory in the $path variable.



 $path = "d:pathtoyourdirectory"
Get-ChildItem $path -Filter "user_*" | ForEach-Object {
echo $_.Name
$folderName = $_.Name.Split("_")[1]
$newPath = Join-Path -Path $path -ChildPath $folderName
If(-not (Test-Path -Path $newPath)) {
New-Item -ItemType directory -Path $path -Name $folderName
}
Move-Item -Path $_.FullName -Destination $newPath
}


It can safely be called several times on the same target.







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 19 '18 at 10:04

























answered Dec 19 '18 at 9:55









VCH

263




263












  • Thank you so much I've been looking for it 3 months ago You have already saved me
    – ABDELRAHMAN BENGHARBI
    Dec 19 '18 at 16:30










  • Can you also answer me on this question superuser.com/questions/1385987/…
    – ABDELRAHMAN BENGHARBI
    Dec 19 '18 at 17:38




















  • Thank you so much I've been looking for it 3 months ago You have already saved me
    – ABDELRAHMAN BENGHARBI
    Dec 19 '18 at 16:30










  • Can you also answer me on this question superuser.com/questions/1385987/…
    – ABDELRAHMAN BENGHARBI
    Dec 19 '18 at 17:38


















Thank you so much I've been looking for it 3 months ago You have already saved me
– ABDELRAHMAN BENGHARBI
Dec 19 '18 at 16:30




Thank you so much I've been looking for it 3 months ago You have already saved me
– ABDELRAHMAN BENGHARBI
Dec 19 '18 at 16:30












Can you also answer me on this question superuser.com/questions/1385987/…
– ABDELRAHMAN BENGHARBI
Dec 19 '18 at 17:38






Can you also answer me on this question superuser.com/questions/1385987/…
– ABDELRAHMAN BENGHARBI
Dec 19 '18 at 17:38





Popular posts from this blog

Probability when a professor distributes a quiz and homework assignment to a class of n students.

Aardman Animations

Are they similar matrix