IPB

Welcome Guest ( Log In | Register )

> foobar2000 Tech Support Forum Rules

Please read foobar2000 Tech Support Forum Rules before posting and comply with all the points.
Failure to provide all the information pointed out in the above document in your post is considered wasting other people's time and in extreme cases will lead to your topic getting locked without a reply.


See also: Hydrogenaudio Terms of Service.

 
Reply to this topicStart new topic
Case conversion?, tag formatting in foobar
humanoidboogie
post Jan 11 2006, 19:27
Post #1





Group: Members
Posts: 14
Joined: 6-December 05
Member No.: 26249



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
Go to the top of the page
+Quote Post
joule
post Jan 11 2006, 21:14
Post #2





Group: Members
Posts: 56
Joined: 1-October 05
Member No.: 24821



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)

This post has been edited by joule: Jan 11 2006, 21:15
Go to the top of the page
+Quote Post
Synthetic Soul
post Jan 11 2006, 22:18
Post #3





Group: Super Moderator
Posts: 4887
Joined: 12-August 04
From: Exeter, UK
Member No.: 16217



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.
Go to the top of the page
+Quote Post
joule
post Jan 11 2006, 22:33
Post #4





Group: Members
Posts: 56
Joined: 1-October 05
Member No.: 24821



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)

=)

This post has been edited by joule: Jan 11 2006, 22:36
Go to the top of the page
+Quote Post
humanoidboogie
post Jan 12 2006, 01:15
Post #5





Group: Members
Posts: 14
Joined: 6-December 05
Member No.: 26249



Brilliant! Just the kind of commands I was looking for. Thanks a lot for all you help! biggrin.gif
Go to the top of the page
+Quote Post
hiscores
post Mar 29 2006, 22:11
Post #6





Group: Members
Posts: 64
Joined: 19-March 06
Member No.: 28587



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.

This post has been edited by hiscores: Mar 29 2006, 22:13
Go to the top of the page
+Quote Post
lav-chan
post Mar 29 2006, 22:29
Post #7





Group: Members
Posts: 358
Joined: 6-March 04
From: Iowa
Member No.: 12503



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.


--------------------
~
Go to the top of the page
+Quote Post
Shade[ST]
post Mar 30 2006, 01:32
Post #8





Group: Members
Posts: 1189
Joined: 19-May 05
From: Montreal, Canada
Member No.: 22144



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)
Go to the top of the page
+Quote Post
kjoonlee
post Mar 30 2006, 02:43
Post #9





Group: Members
Posts: 2525
Joined: 25-July 02
From: South Korea
Member No.: 2782



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 )


--------------------
http://blacksun.ivyro.net/vorbis/vorbisfaq.htm
Go to the top of the page
+Quote Post
hiscores
post Mar 30 2006, 04:26
Post #10





Group: Members
Posts: 64
Joined: 19-March 06
Member No.: 28587



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!
Go to the top of the page
+Quote Post
hiscores
post Mar 30 2006, 05:11
Post #11





Group: Members
Posts: 64
Joined: 19-March 06
Member No.: 28587



Bonus question: how do I get it to replace any instances of '[' with '('?
Go to the top of the page
+Quote Post
kanak
post Mar 30 2006, 06:52
Post #12





Group: Members
Posts: 1190
Joined: 12-January 06
From: Cambridge, MA
Member No.: 27052



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"
Go to the top of the page
+Quote Post
hiscores
post Mar 30 2006, 17:35
Post #13





Group: Members
Posts: 64
Joined: 19-March 06
Member No.: 28587



Thanks Kanak, will do.
Go to the top of the page
+Quote Post
hiscores
post Apr 3 2006, 05:16
Post #14





Group: Members
Posts: 64
Joined: 19-March 06
Member No.: 28587



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?

This post has been edited by hiscores: Apr 3 2006, 05:19
Go to the top of the page
+Quote Post
lav-chan
post Apr 3 2006, 05:51
Post #15





Group: Members
Posts: 358
Joined: 6-March 04
From: Iowa
Member No.: 12503



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.'.


--------------------
~
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th May 2013 - 15:31