mp3 tag/rename based on creation (last modified date)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting mp3 tag/rename based on creation (last modified date)
# 1  
Old 11-23-2009
mp3 tag/rename based on creation (last modified date)

Arg, I'm trying to figure out how to create a album tag based on the last modified date stamp for files which don't have a corresponding .talk file.
IE. 2009 12 10 - Talk Radio.mp3 is how I want them structured, they should all have a corresponding .talk file so my mp3 player can speak the name ie 2009 12 10 - Talk Radio.mp3.talk.
Any file with a .talk file should be skipped because its already been processed manually by me. Here is what I've got in my script so far...

Code:
#!/bin/bash
for f in *.mp3
do
        # if .talk backup file exists, read next file
        if [ -f ${f}.talk ]
        then
                echo "Skiping $f file..."
                continue  # read next file
        fi
        # no talk file exists
        DATE=`stat -c "%y" $f | awk '{print $1}' | sed 's/-/ /g'`
        id3v2 -A "$DATE" "$f"
        mp3rename $f
done

for f in *.mp3
do
        # if .talk backup file exists, read next file
        if [ -f ${f}.talk ]
        then
                echo "Skiping $f file..."
                continue  # read next file
        fi
        # no talk file exists
        echo $f > temp.tmp
        text2wav temp.tmp -o temp.wav
        rbspeexenc temp.wav $f.talk
done

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bourne returning files based on creation date

I'm wanting to write a bourne shell script that takes in two command line arguments - a directory and a file. With this I want to return a list of files within the directory that are older (based on creation date) than the given file, and print the number of files that have not been listed (they... (4 Replies)
Discussion started by: britty4
4 Replies

2. Shell Programming and Scripting

Script to copy creation date over top of modified date?

Can someone draw up a script that for every file, folder and subfolder and files that will copy the creation date over top of the modified date?? I know how to touch every file recursively, but no idea how to read a files creation date then use that to touch the modification date of that file,... (3 Replies)
Discussion started by: toysareforboys
3 Replies

3. UNIX for Dummies Questions & Answers

Unable to find files, those can be present anywhere in the directory tree,based on its creation date

Hi I am unable to find files, those are present anywhere in the same directory tree, based on the creation date. I need to find the files with their path, as I need to create them in another location and move them. I need some help with a script that may do the job. Please help (2 Replies)
Discussion started by: sam192837465
2 Replies

4. UNIX for Dummies Questions & Answers

Select all files in a folder based on creation date (ls command)

Hi All, <Re-posting in Correct group> I'm trying to select all the files in a folder that starts with a particular name format and are created in a gven date range using 'ls' command...but i'm not successful.... Example : I'm trying to see all the text files in a folder who names start... (6 Replies)
Discussion started by: Satya C1
6 Replies

5. Shell Programming and Scripting

Move files from one directory to another based on creation/modification date

Hi All, Really stuck up with a requirement where I need to move a file (Lets say date_Employee.txt--the date will have different date values like 20120612/20120613 etc) from one directory to another based on creation/modification dates. While visiting couple of posts, i could see we can... (3 Replies)
Discussion started by: dsfreddie
3 Replies

6. Programming

how to add user defined tag in a mp3 file?

Hai all, Can anyone explain me about how to add an user defined tag in an mp3 file using MP3::Tag module in perl? (0 Replies)
Discussion started by: thillai_selvan
0 Replies

7. UNIX for Dummies Questions & Answers

Moving Directories Based on Modified date

Hi, How can I move directories (and all sub directories/files) from one directory to another based on the modified date of the directory? Currently the existing structure looks like this: /public_html/media/videos/tmb/34947/image1.jpg /public_html/media/videos/tmb/34947/image2.jpg ... (0 Replies)
Discussion started by: lbargers
0 Replies

8. Shell Programming and Scripting

Rename File Based on Created Date

I am trying to rename files based on the created/born date of the file. I Have a total of 4000 files that i am trying to do this with and would like it to be log_yyyymmddhh.gz right now the files are maillog.???.gz. Can anyone point me in the right direction of how to get this done via scipt? ... (4 Replies)
Discussion started by: Paulb
4 Replies

9. UNIX for Dummies Questions & Answers

Moving files based on creation date

Howdy, I'm trying to figure out how to move multiple files based on their creation date. If anyone can enlighten me it would be most appreciated!! Thanks! :D (1 Reply)
Discussion started by: dgoyea
1 Replies
Login or Register to Ask a Question
ID3REN(1)						      General Commands Manual							 ID3REN(1)

NAME
id3ren - Reads and writes ID3 tags from mp3 files. SYNOPSIS
id3ren [-help] [-song=SONG_NAME] [-artist=ARTIST_NAME] [-album=ALBUM_NAME] [-year=YEAR] [-genre={# | GENRE}] [-comment=COMMENT] [-track=TRACK] [-showgen] [-searchgen={# | GENRE}] [-default=DEFAULT] [-copytagfrom=FILE [-copysong] [-copyartist] [-copyalbum] [-copyyear] [-copygenre] [-copycomment] [-copytrack] [-copyall] ] [-quick] [-noalbum] [-nocomment] [-noyear] [-nogenre] [-notrack] [-tag] [-edit] [-notagprompt | -showtag | -striptag | -tagonly] [-nocfg] [-log] [-quiet] [-verbose] [-defcase | -lower | -upper] [-remchar=CHARS] [-repchar=CHARS] [-space=STRING] [-tagfromfilename | -tagffn] [-tagtemplate=TAGTEMPLATE] [-template=TEMPLATE] [FILE1 FILE2.. | WILDCARDS] COPYRIGHT
id3 Renamer (C) Copyright 1998 by Robert Alto (badcrc@tscnet.com) (C) Copyright 2001 Christophe Bothamy (cbothamy@free.fr) DESCRIPTION
id3ren is used to rename batches of mp3 files by reading the ID3 tag at the end of the file which contains the song name, artist, album, year, and a comment. The secondary function of id3ren is a tagger, which can create, modify, or remove ID3 tags. OPTIONS -album ALBUM_NAME Sets the album name to use when tagging files. All files will be tagged with this album name without prompting. -album=ALBUM_NAME Sets the album name to use when tagging files. All files will be tagged with this album name without prompting. -artist=ARTIST_NAME Sets the artist name to use when tagging files. All files will be tagged with this artist name without prompting. -comment=COMMENT Sets the comment to use when tagging files. All files will be tagged with this comment without prompting. -copyalbum Copies the album field from the source file tag set by -copytagfrom -copyall Copies all the fields from the source file tag set by -copytagfrom -copyartist Copies the artist field from the source file tag set by -copytagfrom -copycomment Copies the comment field from the source file tag set by -copytagfrom -copygenre Copies the genre field from the source file tag set by -copytagfrom -copysong Copies the song field from the source file tag set by -copytagfrom -copytagfrom=FILE Sets the filename to copy tag field from. -copytrack Copies the track field from the source file tag set by -copytagfrom -copyyear Copies the year field from the source file tag set by -copytagfrom -defcase Use the default case of characters from the ID3 tag when renaming files. This is default. -default=DEFAULT Sets the default field to be used only when renaming if a field is blank. Useful when renaming and creating "unknown" subdirecto- ries. Defaults to "unknown". -edit If a file already has a tag and you want to change just one specific field of the tag, use this option in conjunction with -tag and the option for the field you want to change. For example to change just the album name of a file: id3ren -tag -edit -album="New Album Name" sample.mp3 * This option is a toggle. -genre=# | GENRE_NAME Sets the genre to use when tagging files. All files will be tagged with this genre without prompting. To see a list of allowable genres use the -showgen argument. -genre accepts either the number of the genre as displayed with -showgen, or the name of the genre. -help Displays the help screen. -log Log most output to id3ren.log. * This option is a toggle. -lower Convert file names to lowercase characters. -noalbum Don't prompt for the album when adding a tag. * This option is a toggle. -nocfg Don't try reading any config files, even if they exist. * This option is a toggle. -nocomment Don't prompt for a comment when adding a tag. * This option is a toggle. -nogenre Don't prompt for a genre when adding a tag. * This option is a toggle. -notagprompt Never prompt for tag information. Files without tags are skipped. * This option is a toggle. -notrack Don't prompt for the track number when adding a tag. * This option is a toggle. -noyear Don't prompt for the year when adding a tag. * This option is a toggle. -quick Automatically sets -noalbum, -nocomment, and -noyear. -quiet Run quietly, displaying only errors or prompts. * This option is a toggle. -remchar=CHARS CHARS indicates a string of characters that will be removed from the filename if found. -repchar=CHARS CHARS indicates a string of characters, EACH followed by the character to replace it with. For example, to replace all plus '+' signs with a hyphen all '&' with '_', you would use '-repchar +-&_'. -searchgen=# | GENRE Searches the list of genres and displays either the genre name corresponding to #, or shows all substring matches of GENRE. -showgen Displays all the music genres currently in the program. -showtag Display the tags for the specified files. No renaming is performed. -song=SONG_NAME Sets the song name to use when tagging files. All files will be tagged with this song name without prompting. -space=PSTRING Change all spaces in the renamed file to STRING. To remove all spaces, use -striptag Remove the tags for the specified files. * This option is a toggle. -tag Always ask for a tag, even if the file already has one. * This option is a toggle. -tagfromfilename, -tagffn Use informations from the filename when tagging. See tagtemplate. * This option is a toggle. -tagonly Don't rename any files, just ask for tag information. Note that -tagonly only asks for tag information on files that don't have a tag already. To have it ask for a tag on all files, use with -tag. * This option is a toggle. -tagtemplate=TEMPLATE Use TEMPLATE as the basis for tagging files. The default template used is '[%a]-[%s].mp3'. Identifiers that can be used in the template are: %a - Artist name %c - Comment %s - Song name %t - Album title %n - Track Number %y - Year %g - Genre %d - Dummy It is a VERY good idea to have fixed separators between fields. -template=TEMPLATE Use TEMPLATE as the basis for renaming files. The default template used is '[%a]-[%s].mp3'. Identifiers that can be used in the template are: %a - Artist name %c - Comment %s - Song name %t - Album title %n - Track Number %y - Year %g - Genre -track=TRACK Sets the track number to use when tagging files. All files will be tagged with this track number without prompting. TRACK must be an integer between 1 and 99. -upper Convert file names to uppercase characters. -verbose Display more messages than usual. * This option is a toggle. -year=YEAR Sets the year to use when tagging files. All files will be tagged with this year without prompting. And of course the program accepts wildcards for filenames. FILES
*.mp3 All your mp3 files SEE ALSO
lame(1), xmms(1), mpg123(1), mp3blaster(1) BOGUS
If you have questions, comments, or bug reports, please contact cbothamy@free.fr To get the latest version, please visit http://cboth- amy.free.fr/projects/id3ren/ 14 july 2001 ID3REN(1)