DOS wizardry
Author
Discussion

Murph7355

Original Poster:

42,082 posts

287 months

Thursday 27th September 2018
quotequote all
I'm fairly sure this isn't possible, but when in doubt, ask on PH smile

I have a USB stick full of music. Each folder is the artist, each artist has folder(s) for albums and then tracks.

What I want to do is move all the tracks directly under the artist.

My MS command line is reasonably good, but am not sure this is possible. Any ideas?

Or are there utilities that can do this?

FredClogs

14,041 posts

192 months

Thursday 27th September 2018
quotequote all
Eh? Have you not got windows, just cut and paste...

Murph7355

Original Poster:

42,082 posts

287 months

Thursday 27th September 2018
quotequote all
FredClogs said:
Eh? Have you not got windows, just cut and paste...
I'd need to go into every sub-folder and copy them to their root...no?

There are 500 root folders and 2,900+ sub-folders smile

Mr E

23,106 posts

290 months

Thursday 27th September 2018
quotequote all
FredClogs said:
Eh? Have you not got windows, just cut and paste...
Depends how big the memory stick is.


Without looking at the file structure it’s hard to say. I could probably do it from a *nix command line with find -exec, but it might need a script.

rsbmw

3,466 posts

136 months

Thursday 27th September 2018
quotequote all
Would be simple enough with a powershell script

alock

4,575 posts

242 months

Thursday 27th September 2018
quotequote all
Powershell would be easier and it's built into all modern versions of Windows. Do you have programming experience to develop a few concepts, or are you expecting a 100% solution to be provided?

JimbobVFR

2,822 posts

175 months

Thursday 27th September 2018
quotequote all
Do you use MP3tag at all. That can sort files based on tags any way you like.

Murph7355

Original Poster:

42,082 posts

287 months

Thursday 27th September 2018
quotequote all
alock said:
Powershell would be easier and it's built into all modern versions of Windows. Do you have programming experience to develop a few concepts, or are you expecting a 100% solution to be provided?
I might have a dip into powershell a bit (I have programming experience but not recent - hence my ability with DOS...and realised recently that my Unix isn't totally forgotten. Will have to wheel out the Assembler and Fortran77 again soon smile). But....

JimbobVFR said:
Do you use MP3tag at all. That can sort files based on tags any way you like.
...will take a look at this first as yes, I do use MP3Tag smile


Thanks all.

HappyMidget

6,794 posts

146 months

Thursday 27th September 2018
quotequote all
If MP3tag doesn't work and you know *nix, just use the Linux on Windows subsystem for all your BASH needs https://www.howtogeek.com/249966/how-to-install-an...

FredClogs

14,041 posts

192 months

Thursday 27th September 2018
quotequote all
Murph7355 said:
I'd need to go into every sub-folder and copy them to their root...no?

There are 500 root folders and 2,900+ sub-folders smile
If they're all mp3s just do a windows search "*. Mp3" on the root drive and copy and paste the results of the search into a new folder... It might take a whole but it'll be fine. Don't worry.

Murph7355

Original Poster:

42,082 posts

287 months

Thursday 27th September 2018
quotequote all
FredClogs said:
If they're all mp3s just do a windows search "*. Mp3" on the root drive and copy and paste the results of the search into a new folder... It might take a whole but it'll be fine. Don't worry.
I want artists to sit under the artist sub-directories of the root though (unfortunately smile).

FredClogs

14,041 posts

192 months

Thursday 27th September 2018
quotequote all
Murph7355 said:
FredClogs said:
If they're all mp3s just do a windows search "*. Mp3" on the root drive and copy and paste the results of the search into a new folder... It might take a whole but it'll be fine. Don't worry.
I want artists to sit under the artist sub-directories of the root though (unfortunately smile).
Don't panic... they've thought of everything in Windows 8...

When I search my top level "Music" folder for *.mp3 I can arrange them by Album, artist, title as well as folder, rating etc... etc...

HappyMidget

6,794 posts

146 months

Thursday 27th September 2018
quotequote all
Some powershell like the following might work (not tested)


$dir = "C:\Users\user\OneDrive\Music"

cd $dir

$artists = Get-ChildItem -Directory

foreach ($artist in $artists){
Get-ChildItem -Filter *.mp3 -Recurse -File | Move-Item -Destination $artist
}

Who me ?

7,455 posts

243 months

Thursday 27th September 2018
quotequote all
Ye olde DOS program XTREE would allow you to mark files to manipulate or identify files with same extension. Problem was that it would not support long file names. ZTREE fixed that and worked under a DOS window in most Windows versions. The problem is that the last versions were fully functioning, but time limited trial versions. Of course there's always the old DOS move/copy commands with a wildcard,such as copy f*.* or move f*.* where all files starting with f are copied ( SEE https://web.csulb.edu/~murdock/copy.html).

Penelope Stopit

11,209 posts

140 months

Friday 28th September 2018
quotequote all
Use https://www.tinytask.net/

Let it work over night

Perform a test run first with several test folders

Murph7355

Original Poster:

42,082 posts

287 months

Saturday 20th October 2018
quotequote all
HappyMidget said:
Some powershell like the following might work (not tested)


$dir = "C:\Users\user\OneDrive\Music"

cd $dir

$artists = Get-ChildItem -Directory

foreach ($artist in $artists){
Get-ChildItem -Filter *.mp3 -Recurse -File | Move-Item -Destination $artist
}
Only just had chance to play with this...thank you for posting.

It needed a couple of tweaks to achieve what I wanted, but it works nicely as follows:

$dir = "C:\Users\<<root path of files>>"

cd $dir

$artists = Get-ChildItem -Directory

foreach ($artist in $artists){

Get-ChildItem -Path $artist -Filter *.mp3 -Recurse -File | Move-Item -Destination $artist

\* The "path" bit was important here as it brought everything from all directories in and then recursively moved the lot from one artist to the next, leaving all files in the last artist directory. Wasted a bit of time messing with cd commands here until I found path smile

Get-ChildItem -Path $artist -Directory | Remove-Item

\* This cleared up the now empty sub-directories

}



I like Powershell - old DOS experience came in handy (echo; pause; etc) and it seems to have decent Unixy bits in too.

Thanks again all (and especially HappyMidget).

HappyMidget

6,794 posts

146 months

Sunday 21st October 2018
quotequote all
Murph7355 said:
Only just had chance to play with this...thank you for posting.

It needed a couple of tweaks to achieve what I wanted, but it works nicely as follows:

$dir = "C:\Users\<<root path of files>>"

cd $dir

$artists = Get-ChildItem -Directory

foreach ($artist in $artists){

Get-ChildItem -Path $artist -Filter *.mp3 -Recurse -File | Move-Item -Destination $artist

\* The "path" bit was important here as it brought everything from all directories in and then recursively moved the lot from one artist to the next, leaving all files in the last artist directory. Wasted a bit of time messing with cd commands here until I found path smile

Get-ChildItem -Path $artist -Directory | Remove-Item

\* This cleared up the now empty sub-directories

}



I like Powershell - old DOS experience came in handy (echo; pause; etc) and it seems to have decent Unixy bits in too.

Thanks again all (and especially HappyMidget).
Good call, forgot that the script hadn't changed directories from the base dir. Glad it helped

Murph7355

Original Poster:

42,082 posts

287 months

Sunday 21st October 2018
quotequote all
HappyMidget said:
Good call, forgot that the script hadn't changed directories from the base dir. Glad it helped
Getting quite into Powershell now - just used it to strip out some repeat text from 10k filenames.

I sense I am about to cause myself a lot of grief with this now smile

rfsteel

755 posts

201 months

Monday 29th October 2018
quotequote all
Does anyone know of way of taking a MP3 RSS feed and using this data to rename filenames and add ID3 tags to the MP3 file that's already been downloaded ?

e.g.

https://rss.hosting.thisisdax.com/ed87f36a-7b44-4e...


thepeoplespal

1,694 posts

308 months

Thursday 1st November 2018
quotequote all
[quote=Who me ?]Ye olde DOS program XTREE would allow you to mark files to manipulate or identify files with same extension. Problem was that it would not support long file names. ZTREE fixed that and worked under a DOS window in most Windows versions. The problem is that the last versions were fully functioning, but time limited trial versions. Of course there's always the old DOS move/copy commands with a wildcard,such as copy f*.* or move f*.* where all files starting with f are copied ( SEE https://web.csulb.edu/~murdock/copy.html).
[/quote]

XTREE now there is a blast from the past. Although XTREE GOLD was my favourite file manipulation programme, as it could do a few more tricks than the ordinary version.

Rapidfile by Ashton Tate was my favourite programme for working with Dbase3 and .csv files, the macros you could create were so quick and a lot of the abilities of it still haven't been replicated in as simple a way in any programme since.