Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Case conversion? (Read 5686 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Case conversion?

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. 

Case conversion?

Reply #1
Quote
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. 
[a href="index.php?act=findpost&pid=356392"][{POST_SNAPBACK}][/a]


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)

Case conversion?

Reply #2
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().
I'm on a horse.

Case conversion?

Reply #3
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)

=)

Case conversion?

Reply #4
Brilliant! Just the kind of commands I was looking for. Thanks a lot for all you help! 

Case conversion?

Reply #5
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.

Case conversion?

Reply #6
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.
~

Case conversion?

Reply #7
Quote
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.
[a href="index.php?act=findpost&pid=376846"][{POST_SNAPBACK}][/a]

masstagger :

format using fields :
Code: [Select]
$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)

Case conversion?

Reply #8
Quote
Code: [Select]
$caps2(%title%)
$replace(%title%,1St ,1st ,2Nd ,2nd ,3Rd ,3rd ,Th ,th )
[a href="index.php?act=findpost&pid=376899"][{POST_SNAPBACK}][/a]

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

Code: [Select]
$replace($caps2(%title%),1St ,1st ,2Nd ,2nd ,3Rd ,3rd ,Th ,th )

Case conversion?

Reply #9
Quote
Quote
,Mar 30 2006, 09:32 AM]
Code: [Select]
$caps2(%title%)
$replace(%title%,1St ,1st ,2Nd ,2nd ,3Rd ,3rd ,Th ,th )
[a href="index.php?act=findpost&pid=376899"][{POST_SNAPBACK}][/a]

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

Code: [Select]
$replace($caps2(%title%),1St ,1st ,2Nd ,2nd ,3Rd ,3rd ,Th ,th )

[a href="index.php?act=findpost&pid=376917"][{POST_SNAPBACK}][/a]


Thanks guys!

Case conversion?

Reply #10
Bonus question: how do I get it to replace any instances of '[' with '('?

Case conversion?

Reply #11
Quote
Bonus question: how do I get it to replace any instances of '[' with '('?
[a href="index.php?act=findpost&pid=376949"][{POST_SNAPBACK}][/a]


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"

Case conversion?

Reply #12
Thanks Kanak, will do.

Case conversion?

Reply #13
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?

 

Case conversion?

Reply #14
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.'.
~