dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: Play songs by tracknum
From: Matthew A. R. Sherian (
Date: 2004-03-03

Here is a little perl script I I wrote to rename files. If you are using
linux or have Cygwin (


use MP3::Tag;
use Getopt::Long;
my $basedir;
        "batch" => \$batch,
        "single" => \$single,
        "help" => \$help
        die "usage: {--single|--batch}\n";
if ( defined($help) ){
        print "usage: {--single|--batch}\n";

if ( $batch ){
        @ls = split(/\n/,`ls -1`);
        foreach $filename (@ls){
                if ($filename =~ /\.mp3/){

if ( $single ){
        $filename = $ARGV[0] or print "You must supply a file\n";
        if ($filename =~ m#/#){
                foreach $e (@path){
                        $basedir .= "$e/";
        if ($filename =~ /\.mp3/){
sub RN{
        $mp3 = MP3::Tag->new($filename);

        # get some information about the file in the easiest way
        ($song, $track, $artist, $album) = $mp3->autoinfo();
        if ( ! defined $track ){die "No Track Data, please use id3tag to
        $song =~ s/\?//g;
        if ($track <= 9 ){
                $track =~ s/(\d)/0$1/g;
        if ($basedir){
                print "Moving from $filename -> $basedir/$track $song.mp3\n";
                rename ($filename, "$basedir/$track $song.mp3")
                print "Moving from $filename -> $track $song.mp3\n";
                rename ($filename, "$track $song.mp3")

On Wed, 2004-03-03 at 04:47, David Newhook wrote:
> Hi there,
> I'm new to the list but a longtime owner of an archos player 6000. I've
> only got 4.5gb now thanks to an incident with the original drive during a
> very wet hike on a glacier... :p
> I just wanted to know if anyone knows how to, or would like to be able to,
> play a directory of tunes sorted by artist, tracknum then title.
> I haven't found a way to do this yet. I know this can be achieved with
> playlists, but I haven't found a tool for compiling lists in the order I
> want (any suggestions) and to be honest, I think generating all those
> playlists for achieving a simple sort, would be overkill.
> Or maybe everyone simply enjoys listening to their album tracks in
> alphabetical order?
> Suggestions on a postcard please...
> Dave
> _______________________________________________

Page was last modified "Jan 10 2012" The Rockbox Crew