# My filename truncation script

**URL:** https://community.mp3tag.de/t/my-filename-truncation-script/6479
**Category:** General Discussion
**Created:** [March 19, 2008, 6:15am UTC](https://community.mp3tag.de/t/my-filename-truncation-script/6479 "2008-03-19T06:15:23Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [March 21, 2008, 8:34am UTC](https://community.mp3tag.de/t/my-filename-truncation-script/6479/5 "2008-03-21T08:34:46Z")

</div>

> [@Frobozz](#):
>
> My plan for the renaming project is to limit my filenames to 60ish characters or so. My requirements for the filename are that it give me a hint as to what the artist and title is, no filename collisions, sort in track order for each album, and be short enough that I can burn them to a CD or DVD without worrying about having a filename that is too long.  
> I'm thinking about doing something like:  
> [artist max 20 chars] - [album max 20 chars] - [disc #] - [track #] - [title max 20 chars]

Yes, I am going so for years.

Filename including extension is limited to 64 chars.  
I've set a column value of  
'$ifgreater($len(%\_filename\_ext%),64,!$len(%\_filename\_ext%),)'  
to signal when a filename (maybe by manually adjustment) runs over the limit of 64 chars.

I use some special algorithm to condense the content of the envolved tag fields to have all important information at a glance giving me a hint as to what the track, title, artist, album, year is.  
Different track numbers will avoid duplicate filename.  
If more information is needed (for report or so), then the long contents is read directly from the tag fields.

Size Meaning  
02 track  
01 delimiter (underline)  
26 title  
01 delimiter (underline)  
16 artist  
01 delimiter (underline)  
08 album  
01 delimiter (underline)  
04 year  
01 delimiter (dot)  
03 extension  
giving a filename of maximal 64 chars including extension.

DD.20080321.1035.CET

---

_[View the full topic](https://community.mp3tag.de/t/my-filename-truncation-script/6479)._
