Help - Search - Members - Calendar
Full Version: Case conversion?
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Support - (fb2k)
humanoidboogie
I've searched the forums, read all the FAQ's, but I still cannot find any info on how to format my tags properly. I'm a big fan of Mp3tag, but would like to use foobar exclusively.

1. Is there something similar to the "Case conversion "_ALL": Mixed Case" command in Mp3tag?

2. And is there any way of renaming my files in the "tag - filename" manner, using a specific formatstring, such as "%track% - %artist% - %title%"?

3. How do I set up the masstagger to automatically add leading zeros for track numbers (i.e. 01, 02, 03...)?

Any help would be most appreciated... and please be gentle... We all have to learn how to crawl before we can walk. biggrin.gif
joule
QUOTE(humanoidboogie @ Jan 11 2006, 07:27 PM)
I've searched the forums, read all the FAQ's, but I still cannot find any info on how to format my tags properly. I'm a big fan of Mp3tag, but would like to use foobar exclusively.

1. Is there something similar to the "Case conversion "_ALL": Mixed Case" command in Mp3tag?

Probably yes. Please specify the way you mean since i'm not familiar with that software.
QUOTE
2. And is there any way of renaming my files in the "tag - filename" manner, using a specific formatstring, such as "%track% - %artist% - %title%"?

Yes, using masstagger (move, rename, copy files) and set up your own output file name format.
QUOTE
3. How do I set up the masstagger to automatically add leading zeros for track numbers (i.e. 01, 02, 03...)?

Any help would be most appreciated... and please be gentle... We all have to learn how to crawl before we can walk.  biggrin.gif
*



masstagger/edit tags/actions to perform/add/format value from other fields/ set destination field name to "tracknumber" and enter the following as formatting pattern: $num(%tracknumber%,2)
Synthetic Soul
I don't know the description either, but it sounds like you're after $caps() or $caps2().

E.g.: If %title% is "mary had a little LAMB" $caps(%title%) would result in "Mary Had A Little Lamb", while $caps2(%title%) would result in "Mary Had A Little LAMB".

Other relevant functions would be $lower() and $upper().
joule
Alternative is:
$puts(chars,$len(%title%))$upper($left(%title%,1))$lower($right(%title%,$sub($get(chars),1)))

This makes "mary had a little LAMB" become "Mary had a little lamb".

Or:
$puts(chars,$len(%title%))$upper($left(%title%,1))$right(%title%,$sub($get(chars),1))

This makes "mary had a little LAMB" become "Mary had a little LAMB".

(i hope i'm not making a fool out of myself if there is a much simpler function)

=)
humanoidboogie
Brilliant! Just the kind of commands I was looking for. Thanks a lot for all you help! biggrin.gif
hiscores
Can anyone help with a string that would preserve the case of words like "DJ", "1st", "2nd", "R.E.M.", etc while converting everything else to regular title case? Any help would be amazing.
lav-chan
I'm not sure how you would decide which words get capitalised and which don't, it's kind of arbitrary as far as the program is concerned.

As far as i know there isn't really a token function in foobar, so that makes it all the more difficult. You could probably create one yourself using existing functions, and that way you could take care of abbreviations (tokens ending in '.') and ordinals (tokens beginning with numerals), but it'd be kind of long and ugly and maybe not incredibly reliable.
Shade[ST]
QUOTE(hiscores @ Mar 29 2006, 04:11 PM)
Can anyone help with a string that would preserve the case of words like "DJ", "1st", "2nd", "R.E.M.", etc while converting everything else to regular title case? Any help would be amazing.
*


masstagger :

format using fields :
CODE

$caps2(%title%)
$replace(%title%,1St ,1st ,2Nd ,2nd ,3Rd ,3rd ,Th ,th )

This will work as long as you don't need to change anything in UPPER CASE to Upper Case (Title Case)
kjoonlee
QUOTE(Shade[ST] @ Mar 30 2006, 09:32 AM)
CODE

$caps2(%title%)
$replace(%title%,1St ,1st ,2Nd ,2nd ,3Rd ,3rd ,Th ,th )
*

Doing it in a single pass (from the user's point of view) is also possible.

CODE
$replace($caps2(%title%),1St ,1st ,2Nd ,2nd ,3Rd ,3rd ,Th ,th )
hiscores
QUOTE(kjoonlee @ Mar 29 2006, 08:43 PM)
QUOTE(Shade[ST)
,Mar 30 2006, 09:32 AM]
CODE

$caps2(%title%)
$replace(%title%,1St ,1st ,2Nd ,2nd ,3Rd ,3rd ,Th ,th )
*

Doing it in a single pass (from the user's point of view) is also possible.

CODE
$replace($caps2(%title%),1St ,1st ,2Nd ,2nd ,3Rd ,3rd ,Th ,th )

*



Thanks guys!
hiscores
Bonus question: how do I get it to replace any instances of '[' with '('?
kanak
QUOTE(hiscores @ Mar 30 2006, 10:11 AM)
Bonus question: how do I get it to replace any instances of '[' with '('?
*



Use the $replace command.

for ex if you want to replace all the [ to ( in the Title tag:

go to masstagger>Edit tags>Format from other fields

$replace(%title%,'[','(')

the general use of $replace is:

$replace(a,b,c)

finds 'b' in tag 'a' and replaces it with 'c'

PS you might want to check out the titleformatting reference. it documents all (i believe) the "functions"
hiscores
Thanks Kanak, will do.
hiscores
OK, so I've got this script I keep editing that makes little case tweaks in the tags for me. It does things like replacing '2Nd' with '2nd', 'Dj' with 'DJ' -- all the stuff we talked about above. The problem is I want it to do a few other things that are a bit beyond my programming ability. To start, here's an example of the string I have so far:

$replace($caps2(%title%),/,-,Dj ,DJ ,Ii ,II ,1St ,1st ,2Nd ,2nd ,3Rd ,3rd ,Th ,th )

1. I want to change any instances of " (one double quote) to '' (two single quotes), because the former won't show up in a filename whereas the latter will. Problem is, I don't know how to add this into the above string. I've tried adding this sequence (" , '' ,) into it, both with and without single quotes, but I can't get it to work, and when it does, it's at the expense of some other function in the string (ie. the quotes will convert but 'Dj' won't). Is there something I'm doing wrong here?

2. I also want to change the string so that any characters immediately after a . or a - are capitalized. So, rather than R.e.m. I'd get R.E.M., and instead of Bar-kays, I'd get Bar-Kays. Again, I've futzed with the strings but so far this appears to be a bit out of my ability.

I'd totally appreciate any help with either problem. Anyone willing to school a newbie?
lav-chan
1. $replace(whatever,",'''')

The second one i'm not sure. I know you can use $strchr() to find the first . or - in a string, but that won't help you in situations like 'R.E.M.'.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.