# Boolean function difficulty with Export format

**URL:** https://community.mp3tag.de/t/boolean-function-difficulty-with-export-format/70844
**Category:** Mac
**Created:** [March 8, 2026, 10:51pm UTC](https://community.mp3tag.de/t/boolean-function-difficulty-with-export-format/70844 "2026-03-08T22:51:46Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![awck](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/87869e/32.png) [@awck](https://community.mp3tag.de/u/awck)
#### Post date: [March 8, 2026, 10:51pm UTC](https://community.mp3tag.de/t/boolean-function-difficulty-with-export-format/70844/1 "2026-03-08T22:51:46Z")

</div>

I am trying to export tag data to a file (TSV/CSV). I want to add two columns to indicate the external source of the music. One column would contain ‘CD’ or nothing, the other ‘Download’ or nothing. I am trying to use $if(x,y,z) to distinguish the source. After using $strstr to scan %filepath to locate my text indicator. No matter what I specify for x, the z value (false) is substituted. Ex: $if(1,true,false) I can’t find a x that will substitute ‘true’.

Are there any suggestions how to specify a ‘False’ boolean?

Thanks.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [March 9, 2026, 6:09am UTC](https://community.mp3tag.de/t/boolean-function-difficulty-with-export-format/70844/2 "2026-03-09T06:09:07Z")

</div>

> [@awck](#):
>
> $if(x,y,z)

You have to add a comparison operator like $eql or $grtr, e.g  
`$if($grtr($strstr(%_filepath%,CD),0),CD,)`

---

<div class="post-metadata">

### Author: ![awck](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/87869e/32.png) [@awck](https://community.mp3tag.de/u/awck)
#### Post date: [March 9, 2026, 6:34pm UTC](https://community.mp3tag.de/t/boolean-function-difficulty-with-export-format/70844/3 "2026-03-09T18:34:01Z")

</div>

Thanks very much for the fix. It works somewhat. I may be misunderstanding.

I have four sources that I want to identify: CD, Download, Misc, and/or Temp. It seems like once the $grtr 0 is true (string found) subsequent uses of $strstr return a location \> 0 when the target string (y) is actually not in the string (x).

This is the complete format string which includes the &strstr x %\_folderpath% value for debugging aid:

$char(9)%composer%$char(9)%Title%$char(9)%album%$char(9)%local-work%$char(9)%localother%

$char(9)$if($grtr($strstr(%\_folderpath%,CDs),0),CD,not)

$char(9)$if($grtr($strstr(%\_folderpath%,Downloads),0,),DL,not)

$char(9)$if($grtr($strstr(%\_folderpath%,Misc.),0,),Misc,not)

$char(9)$if($grtr($strstr(%\_folderpath%,Temp),0,),Temp,not),

$char(9)%\_folderpath%

This is the formatted export (I don’t know how to make it legible/larger here).

 ![image](https://community.mp3tag.de/uploads/default/original/3X/0/c/0c36551254b431262e47b3272c8173be96da503c.png)

I would appreciate any further light you can shed on this.

Thanks,

Art

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [March 9, 2026, 7:26pm UTC](https://community.mp3tag.de/t/boolean-function-difficulty-with-export-format/70844/4 "2026-03-09T19:26:29Z")

</div>

AFAI can see it, you get a "not" each time the string is not found - which is probably the case 3 out of 4 times.

It would be better to cut the location word from the %\_directory% and then replace it with the desired string, e.g.  
`$replace($regexp(%_directory%,.* - (.*),$1),CDs,CD,Downloads,DL,Misc.,Misc,Temp,Temp)`

---

<div class="post-metadata">

### Author: ![awck](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/87869e/32.png) [@awck](https://community.mp3tag.de/u/awck)
#### Post date: [March 10, 2026, 1:48am UTC](https://community.mp3tag.de/t/boolean-function-difficulty-with-export-format/70844/5 "2026-03-10T01:48:27Z")

</div>

Hi again and thank you for the new suggestion. I did not understand exactly what the output was going to be and based on past experience, I didn’t want to be further confused by regular expressions so I held off working with it.

But I was successful when I changed from using $grtr and comparing the string position with zero.

I used $eql and compare the string position with the fixed location of the target characters in the path. Kind of what I think you were getting at with cut and replacement. It seems to give me what I wanted.

I appreciate your help. Thanks again.

Art

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [March 17, 2026, 1:48am UTC](https://community.mp3tag.de/t/boolean-function-difficulty-with-export-format/70844/6 "2026-03-17T01:48:33Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
