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
ID3(1)							      General Commands Manual							    ID3(1)

NAME
id3 - an ID3 tag editor. SYNOPSIS
id3 [-tTaAycg newdata] file1 [file2 [file3...]] id3 -l file1 [file2 [file3...]] id3 -d file1 [file2 [file3...]] id3 -L DESCRIPTION
id3 is an ID3 v1.1 tag editor. ID3 tags are traditionally put at the end of compressed streamed audio files to denote information about the audio contents. Up to thirty characters of Title, Artist, and Album information can be stored, as well as a 28-character comment, four- digit year, track number up to 255, and an enumerated genre. OPTIONS
-t title Sets the title tag to the first 28 characters of title. -T track Sets the track tag to a number between 0 and 255. -a artist Sets the artist tag to the first 28 characters of artist. -A album Sets the album tag to the first 28 characters of album. -y year Sets the year tag to the first 4 characters of year. -c comment Sets the comment tag to the first 28 characters of comment. -g genre Sets the genre number tag using a genre number or predefined genre label. -l List/view the ID3 tag. -L List all genre tags. -R Use rfc822-style output for tag printout. -d Delete the ID3 tag. BUGS
The ID3 format has some shortcomings. There is a 1 in 16777216 chance of your mp3 having a certain bit-pattern, causing id3 to write over the last 128 bytes of your mp3 upon tag creation. If you add a track number to an ID3 v1.0 tag, the last two characters of the comment string will be truncated. Any bugs found in id3 should be forwarded to the author, Robert Woodcock <rcw@debian.org>. ID3(1)