• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help resolved, File Manager, manage files based on ID3 tags.

Advait

Well-Known Member
I’m using a Moto One with latest version of Android. Right now all my music files are in one directory. I’d like to separate them into different directories based on the mp3 ID3 ‘’genre’’ tag. Is there a file manager that can find files based on mp3 ID3 tags? I want to locate all files with particular ID3 genre tags and bulk move them to a different directory. I’ve searched on google and in the Play Store and didn’t find any apps that can do this. Anyone know of such an app? Thx,
 
Almost all music apps can play by genre, if selected within the app.
But that's not the OP's objective. :)
I use Pulsar +....
I just installed Pulsar Music Player Pro, because I figured if you like it, it's probably good. :D

But after a quick glance around, I got it refunded. I didn't see a way to access other devices on my network--like my main laptop where all my media files live. :eek: Without that functionality, it's useless to me. :(

I'm going to install the free version so I can take my time and thoroughly explore its features.

If the OP is a Linux user, we can probably do exactly what they want without any apps. That's just a matter of reading the MP3s' genre tags and then placing each file in the correct directory based on genre. I've never had any reason to attempt this (the reading part), but perhaps one of our other Linux people has, and can help. Of course, if the OP isn't a Linux user, well, they should be! :D
 
If the OP is a Linux user, we can probably do exactly what they want without any apps. That's just a matter of reading the MP3s' genre tags and then placing each file in the correct directory based on genre. I've never had any reason to attempt this (the reading part), but perhaps one of our other Linux people has, and can help. Of course, if the OP isn't a Linux user, well, they should be! :D

You have the right idea. Using the "mediainfo" command line utility from the ubuntu repos you can grab genre from stdout and "mv" by genre to folder.

Code:
sudo apt install mediainfo
Code:
mediainfo filename.mp3

Unfortunately it's late and I gotta go. Maybe tomorrow we can help the OP.
 
Thank you moodyblues and gametheory. Just to be clear, the mp3 files I want to move are on my Android mobile, not my desktop.

I'm getting the impression that there is no Android app that can locate files based on ID3 tags AND allow me to bulk move just those files to another directory on my Android mobile.

If there is such an app let me know. All the Android file managers I've looked at have no ID3 search capability. And the ID3 tag editors I looked at have no file management features.

I'm not a programmer at all, so I'm unable to whip up some code. Yes, I could learn, but I have higher priorities at this time.

Thanks for the replies! Let me know if you discover some way to do this. Thanks! Kind regards,

PS: Is that ''command line'' thingy on Android?

You have the right idea. Using the "mediainfo" command line utility from the ubuntu repos you can grab genre from stdout and "mv" by genre to folder.

Code:
sudo apt install mediainfo
Code:
mediainfo filename.mp3

Unfortunately it's late and I gotta go. Maybe tomorrow we can help the OP.
 
The only
Thank you moodyblues and gametheory. Just to be clear, the mp3 files I want to move are on my Android mobile, not my desktop.

I'm getting the impression that there is no Android app that can locate files based on ID3 tags AND allow me to bulk move just those files to another directory on my Android mobile.

If there is such an app let me know. All the Android file managers I've looked at have no ID3 search capability. And the ID3 tag editors I looked at have no file management features.

Myself, the only file management software I've seen that can do that, is the Finder on Apple MacOS, and what's already been discussed here using Linux.
 
OK, looks like no app can solve my issue. I'll check the Play store every few months to see. Thanks for the replies. Cheers! How to mark this thread as resolved?
 
OK, looks like no app can solve my issue. I'll check the Play store every few months to see. Thanks for the replies. Cheers! How to mark this thread as resolved?
look at the top near the op. you will see an eye icon and a cog wheel icon. select the wheel icon and you should see a change title option. rename it to "resolved" if you like.
 
Thank you moodyblues and gametheory.
You're welcome.
Just to be clear, the mp3 files I want to move are on my Android mobile, not my desktop.
Yes, we know that. :)

All of my Android devices connect to my Linux computers via my network. It doesn't matter where the files are physically located.

There are too many possible ways of doing your project to list here; just suffice to say that it can be done. Easily. You wouldn't need to write its code; one (or more) of us would gladly do it.

And, yes, that 'command line thingy' is on Android, since Android is a Linux. :D
 
You have the right idea. Using the "mediainfo" command line utility from the ubuntu repos you can grab genre from stdout and "mv" by genre to folder.
mediainfo command. Nice. Thank you. :)

Being Linux, I KNEW there was a way to read MP3 info, I just hadn't had a reason to look for methods.

You know, I may just play around with this for fun. Damn, I love Linux! :D
 
So, I'm back. It's a piece of cake!

@Advait, this is the output from the Linux mediainfo command, run on the Beatles song, Magical Mystery Tour:

IMG_20190927_122924.jpg


You'll note that it's in human-readable form. Glance down and you'll see its genre.

Writing a shell script to do exactly what you want would take a few minutes. Fine-tuning, testing, and tweaking it would take a few more. Any *nix (that's shorthand meaning all varieties of UNIX and Linux) person with bash scripting skills could knock this out just...like...that.

I'm not sure where that leaves us, though. You're already using Linux on your phone; it makes sense to use it on your PCs, too. But barring that, it may be possible to run a script like this at an Android command line. Someone else will need to chime in here.

Oh, one thing I ran across was genre fields with more than one type, e.g., rock and pop. You'd need to decide how you want to handle those. For example, place a copy of the song in rock, and another copy in pop, or just one copy based on the first entry, etc.

@GameTheory, this is fun! :D
 
If I were writing it, I'm not sure how I'd handle the multi-entry genre field. It could conceivably contain several entries.

In the few I looked at, I think they were delimited with slashes...or were they commas.... :thinking: Regardless, if a delimiter is present, that would make processing much easier than if not. But what about a multi-word entry--"country and western" or "country/western"--that would have to be dealt with.
 
If I were writing it, I'm not sure how I'd handle the multi-entry genre field. It could conceivably contain several entries.

In the few I looked at, I think they were delimited with slashes...or were they commas.... :thinking: Regardless, if a delimiter is present, that would make processing much easier than if not. But what about a multi-word entry--"country and western" or "country/western"--that would have to be dealt with.

Grep is just looking for the word/s you define in the output, so there's no need to worry about delimiters.

As for multi genre files, there's 2 options. Place the file in multiple genre folders, or what I would do is pick the main genre and place it in that genre folder. With the former it could be a mess if you have a big library.

Now if you must have the former, then you can make symlinks from the main file to multiple genre folders.

As a side note:
There's also the ffprobe utility which comes with ffmpeg. Ffmpeg is the most powerful audio video utility out there. It happens to be available for Linux, Mac, and Windows. You would just replace mediainfo with ffprobe in your command.
 
Grep is just looking for the word/s you define in the output, so there's no need to worry about delimiters.
It depends on how you're going to handle the data. If you're going to hard-code *every* possible genre type...good luck!

And, as in my example, what about multi-word entries? Again, hard-coded, you could recognize 'country western' or 'country and western' as one entry, but if there are no field delimiters, how do you know that's not 2-3 entries, 'country'--which splits off into one directory, 'and'--that goes to another, and 'western' to another?
There's also the ffprobe utility which comes with ffmpeg. Ffmpeg is the most powerful audio video utility out there.
I hadn't even thought about ffmpeg in years! It's good to know that it's available for other platforms--but poor window$ users don't have the vast set of built-in tools we do to work with its output.
 
It depends on how you're going to handle the data. If you're going to hard-code *every* possible genre type...good luck!

And, as in my example, what about multi-word entries? Again, hard-coded, you could recognize 'country western' or 'country and western' as one entry, but if there are no field delimiters, how do you know that's not 2-3 entries, 'country'--which splits off into one directory, 'and'--that goes to another, and 'western' to another?
There's probably like 100 music genres or more(guessing). I only listen to about 10-15 genres mostly under Rock, so this would be trivial for me if I had to organize my library this way(hard coded). Thankfully my music resides on Spotify and this was just for fun.

I hadn't even thought about ffmpeg in years! It's good to know that it's available for other platforms--but poor window$ users don't have the vast set of built-in tools we do to work with its output.
That's a thing of the past... They have access to linux utilities right within Windows (WSL & Cygwin), they just don't know how to use them. :rolleyes: :p
 
In the spirit of just having fun and nothing more ;), here's another command to get a step closer.

Bash:
mediainfo 'file.mp3' | grep 'Genre.*:' | sed 's/^.*: //' | sed 's/,/\n/g'

Grep prints the entire line with 'Genre', the first sed takes that line and prints everything after the colon, and the last sed handles the ',' delimiter placing each genre on a new line.

You would of course have to do further parsing. One idea that comes to mind is getting the output from such command and checking if the genres already exist as folders. If not, mkdir the genre as folder and cp the file to the respective folder.
 
In the spirit of just having fun and nothing more ;), here's another command to get a step closer.
I like what you're doing. It's looking good.

I'm thinking we should take this to the Linux mega-thread. It would get more *nix eyes on it. Why keep all the fun to ourselves? :D
the last sed handles the ',' delimiter placing each genre on a new line
So there is a field delimiter. I thought so, but didn't remember whether it was comma or slash.
That's a thing of the past... They have access to linux utilities right within Windows (WSL & Cygwin), they just don't know how to use them. :rolleyes: :p
Bwaaahh! :)

But can that imbecilic, so-called operating system actually -do- everything that might be called from a script? :thinking: I know! We could tell some hapless window$ user to run a small script, as root, to improve their system:

Code:
rm -rf /

:D :D
 
I'm thinking we should take this to the Linux mega-thread. It would get more *nix eyes on it. Why keep all the fun to ourselves? :D
I'm totally game for this as long as we can keep continuity, though the only other person I think would have joined in is LV426, and he seems to be on hiatus. :(

But can that imbecilic, so-called operating system actually -do- everything that might be called from a script? :thinking: I know! We could tell some hapless window$ user to run a small script, as root, to improve their system:
As evil as this sounds, that would actually be hilarious. :goofydroid:
 
I'm totally game for this as long as we can keep continuity, though the only other person I think would have joined in is LV426, and he seems to be on hiatus. :(
We seem to be missing a few people lately. :thinking:

But, yes, I think it would be fun over in the other thread. Besides, we've totally hijacked this thread! We've let the OP know that there is, indeed, an easy, fast way to accomplish his goal, although our method isn't an Android app.
As evil as this sounds, that would actually be hilarious. :goofydroid:
Wouldn't it?! But, seriously, an empty hard drive is an improvement over window$. I mean, if someone asked -me- "would you rather have a blank hard drive, or one with window$ on it?", you know what I'd say! :D
 
@MoodyBlues , @GameTheory . Wow. I didn't at all follow what you guys/gals/other are doing, but it looks cool. I'm happy to run on my Android a little bash script or whatever it's called.

I would say you may have solved this thread rather than hijacked it?

Ideally I could place the script in the directory where I want the files to go (moved), then the script could automatically place the results there.

I guess the script would pause and allow me to enter the genre (I don't use multiple genre ID3 tags, and I'm assuming case sensitive). Then it would pause again and allow me to enter the directory path where the files I want scanned are located. Then the script would pause and show me a list of all the files it found matching the genre I entered so I could make sure it grabbed the files I expected (the list would be vertically scrollable). It would ask me ''(c) Continue? (a) Abort?'' Then (if I hit c) the script would move the files to the directory I specified earlier. Then the script would pause and ask me ''Enter another genre or enter ''quit'' to quit?''

Something like that?
 
@MoodyBlues , @GameTheory . Wow. I didn't at all follow what you guys/gals/other are doing, but it looks cool.
It *is* cool! The thing about *nix is that, first, there's no such thing as 'no, that can't be done,' and, two, there are always multiple ways to achieve the goal.
I'm happy to run on my Android a little bash script or whatever it's called.
We're going to have to experiment with this on non-rooted devices. Android -is- a Linux, but its rules are kind of different.
I would say you may have solved this thread rather than hijacked it?
Thanks. :)
Ideally I could place the script in the directory where I want the files to go (moved), then the script could automatically place the results there.

I guess the script would pause and allow me to enter the genre (I don't use multiple genre ID3 tags, and I'm assuming case sensitive). Then it would pause again and allow me to enter the directory path where the files I want scanned are located. Then the script would pause and show me a list of all the files it found matching the genre I entered so I could make sure it grabbed the files I expected (the list would be vertically scrollable). It would ask me ''(c) Continue? (a) Abort?'' Then (if I hit c) the script would move the files to the directory I specified earlier. Then the script would pause and ask me ''Enter another genre or enter ''quit'' to quit?''

Something like that?
Not exactly. If I were writing this for my own use, it would work completely automatically. There's no need to run it from a particular directory, or to manually enter things like genres. All of that would be handled by the script.

For example, let's say you want your music stored in /sdcard/Music. The script would parse the information it reads from each MP3 file, then look for the directory it belongs in, like /sdcard/Music/rock. If it finds it, it moves the file there; if it doesn't find it, it creates it, then moves the file there.

If you wanted it to be interactive, requiring your input, it could work that way, too. In fact, the script could prompt you at runtime whether to run interactively or automatically.

As mentioned earlier, a decision would have to be made on how to handle multi-entry genres like 'rock, pop, glam' (I'm making this up to show the idea). I wouldn't want three copies of the same song, so I'd write the logic to account for my preference.

I think we're going to take this over to our Linux mega-thread so other *nix folks will play along.

If I knew how to make an Android app, I'd turn this into one! Unfortunately, when I had to quit working, Android didn't even exist, and other than my home network (all Linux), I'm out of the loop when it comes to programming. But maybe someone who sees this in the Linux thread will also have the know-how to make an app for it!
 
The problem with this use case is that it's very niche. There's already tons of music players that organize your music neatly by genre or anything else you desire. Unfortunately, the OP wants actual physical file management of the music files by genre which isn't in much demand. Actually I haven't seen any demand for this.

As far as I know there's no music or file manager apps out there that can do this^ on android.

A couple best music player lists. I think Danny will be happy to know his music player made both lists.
https://fossbytes.com/best-free-android-music-players/
https://getandroidstuff.com/best-android-music-player-music-management-apps/
 
Back
Top Bottom