HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: pinky0815 on 2012-12-23 08:43:48

Title: File Operations - Sorting problem
Post by: pinky0815 on 2012-12-23 08:43:48
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

Title: File Operations - Sorting problem
Post by: romor on 2012-12-23 09:13:31
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)
Title: File Operations - Sorting problem
Post by: fbuser on 2012-12-23 09:29:57
^^^^
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 '#'.
Title: File Operations - Sorting problem
Post by: romor on 2012-12-23 09:42:22
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.
Title: File Operations - Sorting problem
Post by: fbuser on 2012-12-23 10:13:59
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%
Title: File Operations - Sorting problem
Post by: romor on 2012-12-23 10:20:15
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.
Title: File Operations - Sorting problem
Post by: pinky0815 on 2012-12-23 10:27:46
Thank you for your answers! I gotta try them later and reply if they work for me!

best regards
Title: File Operations - Sorting problem
Post by: fbuser on 2012-12-23 10:39:55
Hey, gimme a break and stop confusing others if not necessary.
Maybe, you should better follow your own advice.

Pattern works fine.
No, it doesn't.
Try harder.
Better, you should try reading the first post more carefully.

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.