IPB

Welcome Guest ( Log In | Register )

> foobar2000 General Forum Rules

This is NOT a tech support forum.
Tech support questions go to foobar2000 Tech Support forum instead.

See also: Hydrogenaudio Terms of Service.

 
Reply to this topicStart new topic
File Operations - Sorting problem
pinky0815
post Dec 23 2012, 09:43
Post #1





Group: Members
Posts: 2
Joined: 21-December 12
Member No.: 105327



Hi there, i want to sort my music that if i have an artist which starts with any number or any sign like an asterisk (*) or something like that that, they will be moved into the folder "#" and the others in the corresponding folders (i got that already with ($left(%Artist%,1), but i don't know how to do this with numbers and signs).

Thank you in advance

Go to the top of the page
+Quote Post
romor
post Dec 23 2012, 10:13
Post #2





Group: Members
Posts: 672
Joined: 16-January 09
Member No.: 65630



You can create playlist with all your library items then sort by artist - on top it will list the ones you seem to be interested in.

Alternatively, for artists starting with numbers you could try this:

$greater($left(%artist%,1),0)

it will return true if first character is number, and false if char.

and for special chars, maybe this:

$strchr($left(%artist%,1),'~!@#$%^&*-=')

or combined:

$if($or($greater($left(%artist%,1),0), $strchr($left(%artist%,1),'~!@#$%^&*-=')), Yes, No)


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
fbuser
post Dec 23 2012, 10:29
Post #3





Group: Developer
Posts: 682
Joined: 26-September 07
Member No.: 47369



^^^^
This is not a suitable solution for file operations.

Instead try this:
$replace($left(%Artist%,1),*,#,1,#,2,#,3,#,4,#,5,#,6,#,7,#,8,#,9,#)

This will substitute '*' and all numbers with '#'.
Go to the top of the page
+Quote Post
romor
post Dec 23 2012, 10:42
Post #4





Group: Members
Posts: 672
Joined: 16-January 09
Member No.: 65630



QUOTE (fbuser @ Dec 23 2012, 11:29) *
This is not a suitable solution for file operations.

Yes/No is only to provide easier comprehension, if it's not obvious.

If you want literal pattern, here it is:

$if($or($greater($left(%artist%,1),0), $strchr($left(%artist%,1),'~!@#$%^&*-=')),#\)%artist%\%album%\%tracknumber%. %title%

And yes it can be done in couple of different ways.

This post has been edited by romor: Dec 23 2012, 10:43


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
fbuser
post Dec 23 2012, 11:13
Post #5





Group: Developer
Posts: 682
Joined: 26-September 07
Member No.: 47369



Of course, but using Yes/No and referring to sorted playlists can be more misleading than helpful.

By the way, your pattern doesn't work for artists starting with a letter. This one should do it:

$if($or($greater($left(%artist%,1),0), $strchr($left(%artist%,1),'~!@#$%^&*-=')),#,$left(%artist%,1))\%artist%\%album%\%tracknumber%. %title%
Go to the top of the page
+Quote Post
romor
post Dec 23 2012, 11:20
Post #6





Group: Members
Posts: 672
Joined: 16-January 09
Member No.: 65630



Hey, gimme a break and stop confusing others if not necessary.

Pattern works fine. Try harder.
The one that doesn't work is your correction which makes new folder with starting letter from artist name.


--------------------
scripts: http://goo.gl/M1qVLQ
Go to the top of the page
+Quote Post
pinky0815
post Dec 23 2012, 11:27
Post #7





Group: Members
Posts: 2
Joined: 21-December 12
Member No.: 105327



Thank you for your answers! I gotta try them later and reply if they work for me!

best regards
Go to the top of the page
+Quote Post
fbuser
post Dec 23 2012, 11:39
Post #8





Group: Developer
Posts: 682
Joined: 26-September 07
Member No.: 47369



QUOTE (romor @ Dec 23 2012, 11:20) *
Hey, gimme a break and stop confusing others if not necessary.
Maybe, you should better follow your own advice.

QUOTE (romor @ Dec 23 2012, 11:20) *
Pattern works fine.
No, it doesn't.
QUOTE (romor @ Dec 23 2012, 11:20) *
Try harder.
Better, you should try reading the first post more carefully.

QUOTE (romor @ Dec 23 2012, 11:20) *
The one that doesn't work is your correction which makes new folder with starting letter from artist name.
And that is exactly what pinky0815 wants to achieve.
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: 2nd September 2014 - 23:16