# CSV Layout Help Needed

**URL:** <https://community.mp3tag.de/t/csv-layout-help-needed/53662>\
**Category:** Support\
**Created:** [July 3, 2021, 10:54am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662 "2021-07-03T10:54:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![CyPha](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cypha/32/6779_2.png) [@CyPha](https://community.mp3tag.de/u/CyPha)\
**Post date:** [July 3, 2021, 10:54am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/1 "2021-07-03T10:54:01Z")

</div>

Hey Forum, i'm having issues putting together some new code for a database and would really appreciate your help, after hours of staring at a screen i just cant work it out.

In short what i'd like is for mp3tag to discover track's subfiles (i have been working on DIY stems and have vocals.mp3/drums.mp3/bass.mp3 etc in a folder for each track of an album). Once discovered, said files should be listed after the Tracks title once so i can easily export to a google sheet in which the corresponding field will turn green when filled with a Y(es) or red for a N(o), or the first letter of each stem if that's all that can be achieved.

this is the code i have so far

```auto
$loop($if(%albumartist%,%albumartist%,%artist%))%artist%$char(9)$ifgreater(%_total_size_raw%,$loop(%album%,1)$loopend()%_total_size_raw,%_total_size%,1 Album)$loop(%year%)$loop(%album%)
$char(9)$if(%year%,%year%,%date%)$char(9)%album%$char(9)%_total_size%
$loop(%track%,1)$char(9)$num(%track%,2)$char(9)%title%$char(9)%_length%$char(9)%_total_size%$char(9)$char(9)$loop(%title%,10)$if($stricmp(%_filename%,vocals),Vocals,No Vox)$char(9)$if($stricmp(%_filename%,drums),Drums,No Drums)$char(9)$if($stricmp(%_filename%,rhythm),Bass,No Bass)$char(9)$loopend()
$loopend()$loopend()$loopend()
$loopend()

```

and this is what it looks like

```auto
Bloc Party	75.79 MB
	2008	Intimacy	75.79 MB
	02	Mercury	03:53	39.42 MB No Vox	Drums	No Bass	No Vox	No Drums	Bass	No Vox	No Drums	No Bass	Vocals	No Drums	No Bass	
	07	One Month Off	03:39	36.37 MB No Vox	Drums	No Bass	No Vox	No Drums	Bass	No Vox	No Drums	No Bass	Vocals	No Drums	No Bass	

CKY	122.43 MB
	1999	Volume 1	63.65 MB
	01	96 Quite Bitter Beings	03:22	28.38 MB No Vox	Drums	No Bass	No Vox	No Drums	Bass	No Vox	No Drums	No Bass	Vocals	No Drums	No Bass	
	08	Sara's Mask	05:01	35.27 MB No Vox	Drums	No Bass	No Vox	No Drums	Bass	No Vox	No Drums	No Bass	Vocals	No Drums	No Bass	

	2002	Infiltrate Destroy Rebuild	58.78 MB
	01	Escape From Hellview	03:42	31.33 MB No Vox	Drums	No Bass	No Vox	No Drums	Bass	No Vox	No Drums	No Bass	Vocals	No Drums	No Bass	
	06	Shock and Terror	03:07	27.45 MB No Vox	Drums	No Bass	No Vox	No Drums	Bass	No Vox	No Drums	No Bass	Vocals	No Drums	No Bass	

Flymore	415.71 MB
	2009	Millenium IV V	415.71 MB
	01	Intro	01:44	7.85 MB No Vox	Drums	No Bass	No Vox	No Drums	No Bass	Vocals	No Drums	No Bass	
	02	Misunderstanding	04:40	38.64 MB No Vox	Drums	No Bass	No Vox	No Drums	Bass	No Vox	No Drums	No Bass	Vocals	No Drums	No Bass	
	03	Wake Up	04:09	35.63 MB No Vox	Drums	No Bass	No Vox	No Drums	Bass	No Vox	No Drums	No Bass	Vocals	No Drums	No Bass	
	04	All The Time I Bled	03:00	26.88 MB No Vox	Drums	No Bass	No Vox	No Drums	Bass	No Vox	No Drums	No Bass	Vocals	No Drums	No Bass	
	05	My Last Goodbye	04:52	43.46 MB No Vox	Drums	No Bass	No Vox	No Drums	Bass	No Vox	No Drums	No Bass	Vocals	No Drums	No Bass	

```

as you can see it's currently finding the first stem, and ignoring the others  
if i make the line with the stricmp's loop 2 or more times, it finds another stem but still lists all the no finds again

This is sort of what i'm after, i have to get results based on each stem exactly when i call for them otherwise there is no way to get them into those slots every time

> **[Clean Stem Status](https://docs.google.com/spreadsheets/d/19RUTpNwEieffsvS2VimReKRhS05kT9uYLT8Ds1pZAdI/edit?usp=sharing)**
>
> Sheet1
> 
> Bass,Drum,Other,Voice,Instru~,Acapella,Ini File
> ARTIST,ALBUM,#,TRACK,S,T,A,T,U,S,!
> Silverchair
> \[1995\],Frogstomp
> 1,Israel's Son
> 2,Tomorrow
> 3,Faultline
> 4,Pure Massacre
> 5,Shade
> 6,Leave Me Out
> 7,Suicidal...

I'll leave it there to begin with before i over complicate it, thank you so much for any help, i'm already throwing so much of myself into a big music project and braining this is killing me lol

---

<div class="post-metadata">

**Author:** ![CyPha](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cypha/32/6779_2.png) [@CyPha](https://community.mp3tag.de/u/CyPha)\
**Post date:** [July 3, 2021, 11:04am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/2 "2021-07-03T11:04:15Z")

</div>

for some further context of where i'm come from

> **[DIY-Stem-DBv1.1 - Sorted as of Batch 3](https://docs.google.com/spreadsheets/d/1wDI4BldmPrysFTfA09lK0iBOURrGxhYJds2oLwOGEh0/edit?usp=sharing)**
>
> Sheet1
> 
> 
> CyPha SaRin's D.I.Y Multi-Track Stems Collection
> 105 Albums, Between 968-1009 Titles
> Roughly 98 Bands or Artists, with 48 featurettes
> Around 69 Hours &amp; 17 Minutes of Stems
> Expected Stem Count: Around 4036.
> Actual Stem Count: 4015.,some...

I'd originally got it laid out like this about a year ago, and came close again with a new set of code tonight, but i decided i wanted one sheet like this (without the green status boxes) and a more basic one like shown in OP on the side, mostly because i couldn't work out how to combine both ideas without leaving heaps of spacing boxes for the few times i have more than just the 4 main stems (sometimes crowd or a second vocal take etc).

---

<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:** [July 3, 2021, 4:00pm UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/3 "2021-07-03T16:00:39Z")

</div>

If this is the original code then I see at least one syntax error:

> [@CyPha](#):
>
> `loopend()%_total_size_raw,%_total_size%,`

should be  
`loopend()%_total_size_raw%,%_total_size%,`  
If you want to streamline the code a little bit, then the

> [@CyPha](#):
>
> `$if(%albumartist%,%albumartist%,%artist%)`

could become  
`$if2(%albumartist%,%artist%)`

And to be honest: I do not quite understand what a "stem" should be.

> [@CyPha](#):
>
> as you can see it's currently finding the first stem, and ignoring the others

There is a statement `$loop(%track%,1)` in the code - which limits the sorting of track numbers to the first finding of each number - but as the tracknumber varies anyway on most albums, I do not see much point in this limitation.

---

<div class="post-metadata">

**Author:** ![CyPha](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cypha/32/6779_2.png) [@CyPha](https://community.mp3tag.de/u/CyPha)\
**Post date:** [July 4, 2021, 2:27am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/4 "2021-07-04T02:27:13Z")

</div>

Yeah my code is still a bit messy, i had it all going nicely back in 2019, but after a pc loss in 2020 i've had to start over, i found a text file with 'old code' from when i first started, but yes its safe to say its a fixer-upper. I've been able to work out most things, i have it looping quite fine through the folders i need it to be, trying combinations in one loop only leads to the Artist being named many times.

What i'm struggling with is how to have mp3tag look for, i guess, predefined filenames within each track's folder, i've worked out how to make it tell me what files ARE in the folder, but i can't work out how to get a return on when certain "stems" are missing.

I'll elaborate further on what i'm doing in order to show where i've come from / where i'm at.  
I'm using Izotope Rx8 to split tracks into stems, also known as multi-tracks, i have that program outputting flacs, mp3's and Oggs. The flacs are for me, the mp3's are for uploading and sharing to fellow fans/remixers of the music i'm splitting/isolating, and the ogg's are for music games such as Phase Shift/Frets on Fire/Clone Hero.

The outputs come out into one folder, i already had a friend build me something that moves them into respective folders, a 13 track album = 13 folders\> inside an album folder\> inside an artist folder, and within each one of those track folders can be anywhere between 4-12 stems, such as drums.ogg, vocals.ogg, so on..

I've already been using mp3tag to create the song.ini files needed for the ogg's to be read by games,  
I've worked out how to build somewhat of a database as shown in the links, but when it comes to this, "checkbox feature" i'm aiming for, i'm stumped. i tried some $if's some $eql's, and as shown in my latest edit, some $stricmps, but i can only get the results to either only list the first alphabetical stem in a folder, or list them all up to 10 times, just so it can say no i didn't find something it did find only the line before it, as shown in one of my pastes somewhere above..

I need it to tell me when it hasn't found a stem so the corresponding field on a spreadsheet doesn't get lit green by the presence of another stem/file.

---

<div class="post-metadata">

**Author:** ![CyPha](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cypha/32/6779_2.png) [@CyPha](https://community.mp3tag.de/u/CyPha)\
**Post date:** [July 4, 2021, 2:35am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/5 "2021-07-04T02:35:54Z")

</div>

As seen in this sheet, when i'd drag in a "done" folder (a folder that contained a fully split album or batch of albums), and export with my code, i was able to get those discovered stems listed in the place i expected. The problem is the moment i start to introduce folders that have more than those 4 stems, anything with official instrumentals i find, any other isolations that could happen in time, it starts to throw it out of sync, a track like Crowd will be found first and push everything like Drums etc, right one column  
an example of this can be seen at line 66

[https://docs.google.com/spreadsheets/d/1WwNUNcy9EvU8Xo3z3WgnROFTk--oDAmNj9qlJrKs6Wg/edit?usp=sharing](https://docs.google.com/spreadsheets/d/1WwNUNcy9EvU8Xo3z3WgnROFTk--oDAmNj9qlJrKs6Wg/edit?usp=sharing)

---

<div class="post-metadata">

**Author:** ![CyPha](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cypha/32/6779_2.png) [@CyPha](https://community.mp3tag.de/u/CyPha)\
**Post date:** [July 4, 2021, 4:17am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/6 "2021-07-04T04:17:04Z")

</div>

I'm currently trying to rebuild from 0 in order to get my head around how everything works.  
This code is somewhat closer to what i'm looking for, but it still needs 'Nothing Found' returns to fill 'the blanks'. (like where 'crowd.ogg' isn't found, basically everywhere).

```auto
$loop($if2(%albumartist%,%artist%),1)
%artist%
$char(9)'['$if2(%year%,%date%)']' %album%$loop(%album%,1)$loopend()$char(9)$loop(%track%)
$char(9)$char(9)%title%$loop(%album%%title%)$char(9)'['$left(%_filename%,1)']'$loopend()$loopend()
$loopend()

```

```auto

Bloc Party
	[2008] Intimacy	
		Mercury	[D]	[R]	[S]	[V]
		One Month Off	[D]	[R]	[S]	[V]

CKY
	[1999] Volume 1	
		96 Quite Bitter Beings	[D]	[R]	[S]	[V]
		Escape From Hellview	[D]	[R]	[S]	[V]
		Shock and Terror	[D]	[R]	[S]	[V]
		Sara's Mask	[D]	[R]	[S]	[V]

Flymore
	[2009] Millenium IV V	
		Intro	[D]	[S]	[V]
		Misunderstanding	[D]	[R]	[S]	[V]
		Wake Up	[D]	[R]	[S]	[V]
		All The Time I Bled	[D]	[R]	[S]	[V]
		My Last Goodbye	[D]	[R]	[S]	[V]
		I Will Still Sing	[D]	[R]	[S]	[V]
		Queen of the Damned	[D]	[R]	[S]	[V]
		Nothing Personal	[D]	[R]	[S]	[V]
		Insane	[D]	[R]	[S]	[V]
		Hold On	[D]	[S]	[V]
		Live It Up	[D]	[S]	[V]
		My Destination	[D]	[S]	[V]
		Asylum	[D]	[R]	[S]	[V]
		All The Time I Bled Remix	[D]	[R]	[S]	[V]

Groove Armada
	[2004] The Best of Groove Armada	
		Think Twice	[C]	[D]	[I]	[R]	[S]	[V]

Incubus
	[2001] Morning View	
		Nice To Know You	[D]	[R]	[S]	[V]
		Circles	[D]	[R]	[S]	[V]
		Wish You Were Here	[D]	[R]	[S]	[V]
		Just A Phase	[D]	[R]	[S]	[V]
		11am	[D]	[R]	[S]	[V]
		Blood On The Ground	[D]	[R]	[S]	[V]
		Mexico	[D]	[R]	[S]	[V]
		Warning	[D]	[R]	[S]	[V]
		Echo	[D]	[R]	[S]	[V]
		Have You Ever	[D]	[R]	[S]	[V]
		Are You In	[D]	[R]	[S]	[V]
		Under My Umbrella	[D]	[R]	[S]	[V]
		Aqueous Transmission	[D]	[R]	[S]	[V]

```

My assumption is that i need some kind of IF code in there somewhere  
if first \_filename is crowd then [C], but if not then N/A or something  
if second \_filename is drums then [D], so on

---

<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:** [July 4, 2021, 7:52am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/7 "2021-07-04T07:52:07Z")

</div>

I don't have teh environment that you have.  
But it could be worthwhile to have a look at $puts() and $get().  
I would set an initial string with tick boxes for maximum number of possible criteria like  
`[-] [-] [-] [-] [-] [-] `  
and then fill each position with $IF() and $left() and $mid()  
so that e.g. if there are drums to be noted, the string looks like this afterwards:  
`[-] [D] [-] [-] [-] [-] `  
and if there are vocals:  
`[-] [D] [-] [-] [-] [V] `  
The problem that you try to overcome: how to get information out of the absence of information.  
Alternatively, you create more style indicator files that each reflect the 2 stages: present or absent, e.g. crowd\_yes.ogg or crown\_no.ogg.

---

<div class="post-metadata">

**Author:** ![CyPha](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cypha/32/6779_2.png) [@CyPha](https://community.mp3tag.de/u/CyPha)\
**Post date:** [July 4, 2021, 8:10am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/8 "2021-07-04T08:10:26Z")

</div>

Yeah, i sort of follow, it at least points me in the right direction, i think my main struggle is not being able to wrap my head around the loop concept still, i blame my slight aspergers lol.  
I'm still playing around with loops atm to get to understand them, putting loops in loops etc, working out where to end loops. I'll keep playing around with it.  
If you're able to write up any line of code to show what you mean in a bit more detail, that would be a big help. thank you for your replies thus far 🙂  
-i'm still just lost where to actually put the gets, it would have to be getting while in a certain loop and thats where i get fuzzy

This is just about as basic as i can get the code for now, with the exception of the %\_filename% part.  
I had all the other details added back in 2019, so i know i can get all that stuff back again, so i'm happy to keep it simple to try to narrow down this issue and understand every part of a loop.

```auto
$loop(%artist%,1)%artist%
$loop(%album%,1)%album%
$loop(%track%,1)%title%$char(9)$char(9)$loop(%track%)$char(9)%_filename%$loopend()
$loopend()
$loopend()$loopend()

```

---

<div class="post-metadata">

**Author:** ![CyPha](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cypha/32/6779_2.png) [@CyPha](https://community.mp3tag.de/u/CyPha)\
**Post date:** [July 6, 2021, 11:39pm UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/9 "2021-07-06T23:39:03Z")

</div>

I've tried so many variations in the last 48 hours. i've tried puts' and get's, if's, eql's, not's, some of them inside others, i've more or less established how loops work and yet i still can't get around this obstacle, i've been able to make loops like this in Foobar but i guess mp3tag uses some slight alteration.

I've tried stuff like this and a million things between  
some of it has stuff that doesn't need to be there, the numbers and what not, i've just been using some identifiers to try to see how the code works on export

```auto
$loop(%artist%,1)%artist%
$loop(%album%,1)$char(9)%album%
$loop(%track%,1)$char(9)$char(9)%title%$char(9)$char(9)Stems: $loop(%_workingdir%,8)
$if($eql(%_filename%,Crowd),%_filename%,$if($not(%_filename%,crowd),No Crowd,)$if($eql(%_filename%,Drums),%_filename%,$if($not(%_filename%,drums),No Drums,)))$loopend()
$loopend()$loopend()
$loopend()

```

```auto
$loop(%artist%,1)%artist%
$loop(%album%,1)$char(9)%album%
$loop(%track%,1)$char(9)$char(9)%title%$char(9)$char(9)Stems: $loop(%title%)
$if($eql(%_filename%,Crowd),1Crowd$if($eql(%_filename%,Drums),1Drums$if($eql(%_filename%,Guitar),1Guitar$if($eql(%_filename%,Instrumental),1Instrumental$if($eql(%_filename%,keys),1Keys$if($eql(%_filename%,rhythm),1Rhythm$if($eql(%_filename%,song),1Song$if($eql(%_filename%,vocals),1Vocals,),),),),),),),
$if($eql(%_filename%,Drums),2Drums$if($eql(%_filename%,Guitar),2Guitar$if($eql(%_filename%,Instrumental),2Instrumental$if($eql(%_filename%,keys),2Keys$if($eql(%_filename%,rhythm),2Rhythm$if($eql(%_filename%,song),2Song$if($eql(%_filename%,vocals),2Vocals,),),),),),),
$if($eql(%_filename%,Guitar),3Guitar$if($eql(%_filename%,Instrumental),3Instrumental$if($eql(%_filename%,keys),3Keys$if($eql(%_filename%,rhythm),3Rhythm$if($eql(%_filename%,song),3Song$if($eql(%_filename%,vocals),3Vocals,),),),),),
$if($eql(%_filename%,Instrumental),4Instrumental$if($eql(%_filename%,keys),4Keys$if($eql(%_filename%,rhythm),4Rhythm$if($eql(%_filename%,song),4Song$if($eql(%_filename%,vocals),4Vocals,),),),),
$if($eql(%_filename%,keys),5Keys$if($eql(%_filename%,rhythm),5Rhythm$if($eql(%_filename%,song),5Song$if($eql(%_filename%,vocals),5Vocals,),),),
$if($eql(%_filename%,rhythm),6Rhythm$if($eql(%_filename%,song),6Song$if($eql(%_filename%,vocals),6Vocals,),),
$if($eql(%_filename%,song),7Song$if($eql(%_filename%,vocals),7Vocals,),
$if($eql(%_filename%,vocals),8Vocals,))))))))$loopend()
$loopend()$loopend()

$loopend()

```

i feel like these come close but are not quite there  
that smaller set finds the parts, but that $not code is not working for when it doesn't find a crowd track, still just names drums.

---

<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:** [July 7, 2021, 4:42am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/10 "2021-07-07T04:42:34Z")

</div>

The longish list of $if()s ... Don't you always use the filename but with a capitalized first letter? So the whole list could be shortened to $caps(%\_filename%)?  
Alternatively, what about a $replace(%\_filename%,Crowd,1Crowd,Drums,1Drums ...,Instrumental,3Instrumental,...)  
The duplication of "song" into 6Song and 7Song will probably not work, though - unless you use the statement "`...,song,"6Song,7Song",...)`"  
I still don't get it where the problem lies? That you don't get right amount of indents?

---

<div class="post-metadata">

**Author:** ![CyPha](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cypha/32/6779_2.png) [@CyPha](https://community.mp3tag.de/u/CyPha)\
**Post date:** [July 7, 2021, 5:46am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/11 "2021-07-07T05:46:33Z")

</div>

I went until 2am last night trying so many variations, that was just the one i was able to pull back up, i haven't been saving a lot of my tries, in ways it's been a dumb move. All the digits at the starts of the filename titles were only there so i could see on the extract which line of ifs was finding what OGG's at which times, all i really did was find other ways to do jobs that could already be done with more basic lines of code lol.  
Basically the issue is its still not returning anything when it doesn't find something, or its over reporting that its not finding anything, as maybe seen below.  
for example it would run through the if's, if the folder has a crowd.ogg present, it will list that and jump to the part of the chain with all the 2's, but then if it doesn't it still jumps to the 2's, then that will look for drums, but i couldn't find anywhere in the lines to put something to say it didn't find Crowd, as i need that slot to be filled with something so it aligns in the spreadsheet i import too.

this is an idea of one of the results i was getting

```auto
Flymore
	Millenium IV V
		Intro Stems: 
1
Drums
1
2
3
4
5
6
Song
1
2
3
4
5
6
7
Vocals
		Misunderstanding Stems: 
1
2
3
4
5
Rhythm
1
2
3
4
5
6
Song
1
2
3
4
5
6
7
Vocals
		Wake Up Stems: 
1
Drums
1
2
3
4
5
Rhythm
1
2
3
4
5
6
7
Vocals
		All The Time I Bled Stems: 
1
Drums
1
2
3
4
5
Rhythm
1
2
3
4
5
6
Song
		My Last Goodbye Stems: 
Crowd
1
Drums
1
2
3
4
5
Rhythm
1
2
3
4
5
6
Song
		I Will Still Sing Stems: 
1
Drums
1
2
3
4
5
Rhythm
1
2
3
4
5
6
Song
1
2
3
4
5
6
7
Vocals

```

as you can see i threw in some more numbers for visuals at one point, just to get an idea of where im supposed to be able to inject some kinda feedback on the IF not finding a result, but then obviously it wants to run through that list over at over, being that i have it set that way, once my project is fully underway, i wish to have enough room for folders with somewhere up to 14 Multi-tracks or Stems within.  
I removed 1 stem from each to get more variables, that's why most songs only reported 3 above.

In the meanwhile i've also been working on another method, but now its called for me to know more about spreadsheets than i do.  
I'm not expecting anyone's help on that on these pages, but i'll show that here for clarity

```auto
ARTIST	YEAR	ALBUM	#	TRACK	LENGTH	SIZE | BITRATE	SAMPLERATE$repeat($char(9),6)_	S	T	E	M	_	P	A	R	T	S	_	
$repeat($char(9),13)C	D	G	I	K	V	D1	D2	D3	D4	V1	V2

$loop($if2(%albumartist%,%artist%))%artist%$char(9)$loop(%year%)$loop(%album%)
$char(9)$if(%year%,%year%,%date%)$char(9)%album%$repeat($char(9),4)%_total_size%
$loop(%track%,1)$repeat($char(9),3)$num(%track%,2)$char(9)%title%$char(9)%_length%$char(9)%_total_size%$char(9)%_samplerate% HZ [| %_bitspersample%]$repeat($char(9),18)$loop(%_workingdir%)'['$left(%_filename%,1)']'$loopend()
$repeat($char(9),5)$loop(%_workingdir%)$left(%_filename%,1): %_file_size% | %_bitrate% KB/s$char(9)$loopend()
$loopend()$loopend()$loopend()
$loopend()

$repeat($char(9),4)Submitted: %_datetime%$char(9)$puts(TRUESEC,$div(%_total_time_raw%,4))$puts(SECONDS,$mod($get(TRUESEC),60))$puts(TMS,$sub($get(TRUESEC),$get(SECONDS)))$puts(MINUTES,$mod(%div($sub($get(TRUESEC),$get(SECONDS)),60),60))$puts(HOURS,$mod($div($div($sub($get(TMS),$mul($get(MINUTES),60)),60),60),24))$puts(DAYS,$div($div($div($sub($get(TMS),$mul($get(MINUTES),60),$mul($get(HOURS),60),60),60),60),24))$get(R5)Total [$get(DAYS)d]$get(HOURS):$get(SECONDS):$num($get(MINUTES),2)$char(9)%_total_size%

```

This is how it comes out on sheet. [Copy of DIY-Stem-DBv1.1 - New for Batch 2021 - Google Tabellen](https://docs.google.com/spreadsheets/d/1WwNUNcy9EvU8Xo3z3WgnROFTk--oDAmNj9qlJrKs6Wg/edit?usp=sharing)  
The idea is to have all the stems go to the Z column and then hopefully i can get a mate to teach me how to get columns N-Y to read their respective row numbers in column Z and find their desired letter, and upon finding that turn green.

I'm honestly not sure what method has been closer, i thought i was onto something with the puts and gets, but they're tricky, am i right in thinking new loops wipe puts out?

---

<div class="post-metadata">

**Author:** ![CyPha](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cypha/32/6779_2.png) [@CyPha](https://community.mp3tag.de/u/CyPha)\
**Post date:** [July 7, 2021, 5:53am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/12 "2021-07-07T05:53:29Z")

</div>

I think this is the result for the code i posted an hour or so ago.  
same thing really, doesn't report the no find in IF 1's, jumps to 2's and finds the drums present.  
Below you'll find the last artist has crowd, instru.

```auto
Bloc Party
	Intimacy
		Mercury Stems: 2Drums6Rhythm7Song8Vocals
		One Month Off Stems: 2Drums6Rhythm7Song8Vocals

CKY
	Infiltrate Destroy Rebuild
		Escape From Hellview Stems: 2Drums6Rhythm7Song8Vocals
		Shock and Terror Stems: 2Drums6Rhythm7Song8Vocals
	Volume 1
		96 Quite Bitter Beings Stems: 2Drums6Rhythm7Song8Vocals
		Sara's Mask Stems: 2Drums6Rhythm7Song8Vocals

Flymore
	Millenium IV V
		Intro Stems: 2Drums7Song8Vocals
		Misunderstanding Stems: 2Drums6Rhythm7Song8Vocals
		Wake Up Stems: 2Drums6Rhythm7Song8Vocals
		All The Time I Bled Stems: 2Drums6Rhythm7Song8Vocals
		My Last Goodbye Stems: 1Crowd2Drums6Rhythm7Song8Vocals
		I Will Still Sing Stems: 2Drums6Rhythm7Song8Vocals
		Queen of the Damned Stems: 2Drums6Rhythm7Song8Vocals
		Nothing Personal Stems: 2Drums6Rhythm7Song8Vocals
		Insane Stems: 2Drums6Rhythm7Song8Vocals
		Hold On Stems: 2Drums7Song8Vocals
		Live It Up Stems: 2Drums7Song8Vocals
		My Destination Stems: 2Drums7Song8Vocals
		Asylum Stems: 2Drums6Rhythm7Song8Vocals
		All The Time I Bled Remix Stems: 2Drums6Rhythm7Song8Vocals

Groove Armada
	The Best of Groove Armada
		Think Twice Stems: 1Crowd2Drums4Instrumental6Rhythm7Song8Vocals

```

---

<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:** [July 7, 2021, 6:24am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/13 "2021-07-07T06:24:27Z")

</div>

Just a short idea:  
You initialize a string like `$puts([-] [-] [-] [-] [-],stems)`  
And then you compare `$if($eql(%_filename,Crowd),$puts($left($get(stems),1)C$mid($get(stems),3,17),stems),)`  
(I hope that I got all the brackets right).  
The result should be `[C] [-] [-] [-] [-]` in the variable stems.  
This string holds the information that no data is available until told otherwise.  
After all comparisons are through, you have a string like:  
`[C] [D] [R] [-] [V]`  
(which reminds me: can you have a song without vocals - would be redundant information otherwise)  
which means: Crowd, Drums, Rhythm, no song, Vocals

---

<div class="post-metadata">

**Author:** ![CyPha](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cypha/32/6779_2.png) [@CyPha](https://community.mp3tag.de/u/CyPha)\
**Post date:** [July 7, 2021, 6:42am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/14 "2021-07-07T06:42:15Z")

</div>

Okay nice, nice, i've exhausted my brain for the next few hours but i'll take a look at that in a short while and try to implement it, thank you

About a song without vocals, I guess there is a chance for it, some of the stuff i've been isolating might be an instrumental song on an album, or i might be running through a single CDS from the 90's with a bunch of official instrumentals, it makes for cleaner stems, vocal bleed on the other tracks is the biggest issue i seem to currently face otherwise. However, in most cases i would probably run those versions in batch processors with other albums overnight, resulting in empty but present vocal.oggs. I'm not sure if it helps with your question as i don't fully follow it. but track 4 from Flymore, All The Time I Bleed, i removed it's vocal track from my list in mp3tag at some point through my testing phase to at least reflect what a folder would do without Vocal's present.

If i have that the wrong way around and you're asking can song.ogg be missing, No, not if Guitar is also missing. If i remember correctly the program i use to play these stems as their full songs with volume sliders and or other control (Phase Shift Mixer by DJ Lastnight on DWSK Forum Boards or Github) and the music game Phase Shift itself, both require either Song or Guitar to be present for those to want to play the song, as well as a song.ini for the Mixer and both a song.ini and notes.ini for Phase Shift. So with those limitations set down the way, i consider them one now.

---

<div class="post-metadata">

**Author:** ![CyPha](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cypha/32/6779_2.png) [@CyPha](https://community.mp3tag.de/u/CyPha)\
**Post date:** [July 7, 2021, 7:54am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/15 "2021-07-07T07:54:48Z")

</div>

I've put in all my variables and set out the code as best as i could, here's what it looked like before i put it all on one line for exporting, just for your readings sake

```auto
$loop(%artist%,1)%artist%
$loop(%album%,1)$char(9)%album%
$loop(%track%,1)$char(9)$char(9)%title%$char(9)$char(9)Stems: $loop(%_workingdir%)
$puts([-] [-] [-] [-] [-] [-] [-] [-],stems)
$if($eql(%_filename,Crowd),$puts($left($get(stems),1)C$mid($get(stems),3,29),stems),)
$if($eql(%_filename,Drums),$puts($left($get(stems),1)D$mid($get(stems),7,25),stems),)
$if($eql(%_filename,Guitar),$puts($left($get(stems),1)G$mid($get(stems),11,21),stems),)
$if($eql(%_filename,Instrumental),$puts($left($get(stems),1)I$mid($get(stems),15,17),stems),)
$if($eql(%_filename,Keys),$puts($left($get(stems),1)K$mid($get(stems),19,13),stems),)
$if($eql(%_filename,Rhythm),$puts($left($get(stems),1)D$mid($get(stems),23,9),stems),)
$if($eql(%_filename,Song),$puts($left($get(stems),1)S$mid($get(stems),27,5),stems),)
$if($eql(%_filename,Vocals),$puts($left($get(stems),1)V$mid($get(stems),31,1),stems),)
$get(stems)
$loopend()
$loopend()$loopend()

$loopend()

```

The results

```auto
Bloc Party
	Intimacy
		Mercury Stems: 
		One Month Off Stems: 

CKY
	Infiltrate Destroy Rebuild
		Escape From Hellview Stems: 
		Shock and Terror Stems: 
	Volume 1
		96 Quite Bitter Beings Stems: 
		Sara's Mask Stems: 

Flymore
	Millenium IV V
		Intro Stems: 
		Misunderstanding Stems: 
		Wake Up Stems: 
		All The Time I Bled Stems: 
		My Last Goodbye Stems: 
		I Will Still Sing Stems: 
		Queen of the Damned Stems: 
		Nothing Personal Stems: 
		Insane Stems: 
		Hold On Stems: 
		Live It Up Stems: 
		My Destination Stems: 
		Asylum Stems: 
		All The Time I Bled Remix Stems: 

Groove Armada
	The Best of Groove Armada
		Think Twice Stems: 

```

actual code used

```auto
$loop(%artist%,1)%artist%
$loop(%album%,1)$char(9)%album%
$loop(%track%,1)$char(9)$char(9)%title%$char(9)$char(9)Stems: $loop(%_workingdir%)$puts([-] [-] [-] [-] [-] [-] [-] [-],stems)$if($eql(%_filename,Crowd),$puts($left($get(stems),1)C$mid($get(stems),3,29),stems),)$if($eql(%_filename,Drums),$puts($left($get(stems),1)D$mid($get(stems),7,25),stems),)$if($eql(%_filename,Guitar),$puts($left($get(stems),1)G$mid($get(stems),11,21),stems),)$if($eql(%_filename,Instrumental),$puts($left($get(stems),1)I$mid($get(stems),15,17),stems),)$if($eql(%_filename,Keys),$puts($left($get(stems),1)K$mid($get(stems),19,13),stems),)$if($eql(%_filename,Rhythm),$puts($left($get(stems),1)D$mid($get(stems),23,9),stems),)$if($eql(%_filename,Song),$puts($left($get(stems),1)S$mid($get(stems),27,5),stems),)$if($eql(%_filename,Vocals),$puts($left($get(stems),1)V$mid($get(stems),31,1),stems),)$get(stems)$loopend()
$loopend()$loopend()

$loopend()

```

So yeah, currently getting no returns at all aha, where did i go wrong

---

<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:** [July 7, 2021, 8:05am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/16 "2021-07-07T08:05:46Z")

</div>

$get really only reads the variable.  
$puts writes the variable silently.  
To output the variable, you need at least one not silent $put() like $put($get(stems),stems)

---

<div class="post-metadata">

**Author:** ![CyPha](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cypha/32/6779_2.png) [@CyPha](https://community.mp3tag.de/u/CyPha)\
**Post date:** [July 7, 2021, 8:25am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/17 "2021-07-07T08:25:24Z")

</div>

That just returns whatever the final word in the code is, in this case

```auto
CKY
	Infiltrate Destroy Rebuild
		Escape From Hellview Stems: stemsstemsstemsstems
		Shock and Terror Stems: stemsstemsstemsstems
	Volume 1
		96 Quite Bitter Beings Stems: stemsstemsstemsstems
		Sara's Mask Stems: stemsstemsstemsstems

```

---

<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:** [July 7, 2021, 8:49am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/18 "2021-07-07T08:49:38Z")

</div>

Sorry, I probably used an invalid syntax and swapped contents and variable - perhaps  
$put(stems,$get(stems)) is better.  
(you would have to check if this got mixed in the previous $puts() as well).

---

<div class="post-metadata">

**Author:** ![CyPha](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cypha/32/6779_2.png) [@CyPha](https://community.mp3tag.de/u/CyPha)\
**Post date:** [July 7, 2021, 8:53am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/19 "2021-07-07T08:53:14Z")

</div>

> [@ohrenkino](#):
>
> $put(stems,$get(stems))

yeah i might have already tried that, but i'll check it again, and i'll have a look at the previous ones, that did stump me a bit before, i didn't know if the name should go before the variable or after in a put/s, i'm still a little confused haha.  
However, i'm just wondering about using brackets, are they maybe causing issues without ' ' around them?  
One more thing that caught my eye was the $left($get(stems),1) section of any of the search lines, is that just bringing up a [?

- yeah im starting to get something, moved the word 'stems' to the start of all the puts searching for stem parts, and at the bottem put/get pulling it for display.

---

<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:** [July 7, 2021, 9:00am UTC](https://community.mp3tag.de/t/csv-layout-help-needed/53662/20 "2021-07-07T09:00:08Z")

</div>

> [@CyPha](#):
>
> One more thing that caught my eye was the $left($get(stems),1) section of any of the search lines, is that just bringing up a [?

That was the intention - but you need a higher value in $left() if you want to address the next opening bracket.  
If that square bracket causes problems, use a different character - the square brackets are more or less just decoration which could be left out altogether. I only tried to show that one can overcome the problem of missing data with a dedicated place for existing data and a placeholder for the missing stuff.

[Next page](https://community.mp3tag.de/t/csv-layout-help-needed/53662.md?page=2)
