Thank you both for taking the time to walk me through all this!
I'm not sure which expression you're saying doesn't work. Can you clarify?
The code I was decribing the behavior was this code
Τ Mid(★★★★★,0,[Rating]);/
Σ [a.Rating.x];/
Δ IfElse(
IsEqual([File Type], log), / Log,
IsEqual([File Type], flac, 8), ★★★★★,
Compare([Bitrate], >, 256), ★★★★,
Compare([Bitrate], >, 192), ★★★,
Compare([Bitrate], >, 128), ★★,
1, ★
)/
&DataType=[List]
Even if I get rid of the first 2 rating scehemes and just leave the bitrate scheme I could not get it to do anything. As I said I entered it as an expression, is that wrong? I am not sure if whatever I am doing wrong to not get this working is meaning my subsequent attempts at the things below are also failing.
I will try your other code tomorrow, as I am out tonight.
However I am not working at full speed today, so please bear with me whilst I share these thoughts.
A)
This code outputs numbers:
regex([Filename (path)], /#\[[A-Z]*(\d+)kps\]#/, 1, 1)
It is this set of numbers I want to group
B)
Taking this array I would like it formatted something like:
1 - 160 [=isrange([EXTRACTED_TEXT],1-160)]=1
161 - 320 [=isrange([EXTRACTED_TEXT],161-320)]=1
HIGH [=isrange([EXTRACTED_TEXT],321-99999)]=1
adding additional groupings (eg at 128,192,256 etc) as required
As I understand it from your new code, [EXTRACTED_TEXT] will be [R1] from the regex?
C)
You are suggesting using this code:
ifelse(
!regex([Filename (path)], /#\[[A-Z]*(\d+)kps\]#/, 0, 1), No KPS detected,
Compare([R1], >, 320), 320+,
1, [R1]
)
As I understand it your first line handles the No KPS detected case.
The second line creates a >320k case
In your third line test 3, "1" is always true, so I think it outputs all EXTRACTED_TEXT values as captured in [R1] by the regex?
formatrange([R1], 160, 2) groups by 160, but for custom groupings I assume I can either create more cases before the "1" or use something like (B)?
So for example is this right? :
ifelse(
!regex([Filename (path)], /#\[[A-Z]*(\d+)kps\]#/, 0, 1), No Album KPS detected,
Compare([R1], >, 320), Lossless,
Compare([R1], >, 318), 320k,
Compare([R1], >, 255), 256k-320k,
Compare([R1], >, 192), 192k-255k,
1, formatrange([R1], 32, 2)
)
D)
I would be happy either adding the extracted text (eg 221), or the grouped version (161-320) to a custom field if that helps - is there any benefit to this? If there is, how would I do it.
Thank you again for your support!