Help regarding export filename, please.


#1

So I generally export NFOs. The problem is I dont know how to figure out the 00s in front of NFO file so that it remains on top among audiofils that starts with 01, 02 etc.

Scenario is I have 3 types of file names. Audio files starting from 1, 01 and 001. I want NFO to be numbered as 0, 00 and 000 respectively according to the audiofiles in directory.

Please help so that I can put everything in one code. Currently I use this:

%_folderpath%\$lower($replace(00-$cutLeft(%_filename%,3))).nfo

But it obviously cuts first alphabet when file name starts from 1.

Or any other alternative in export to get the filenames starting as 0, 00 and 000 according to the situation.

So I seek help regarding export file name.


#2

... what about
%_folderpath%\00-$cutLeft(%_filename%,3).nfo


#3

because I want the nfo filename to be same like audio file name. Audio file names are all same, only differs the number of track.


#4

Then I don't understand the organization of the files and how many nfo-files should be there in the end.
Please give a concrete example of 2 audio file names with different track numbers and the corresponding nfo-filenames.


#5

Ok, when I run my export tags for NFO it give me this result. :rolleyes:

Example One:
Filenames:
1-human_heart_cosmic_heart.mp3
2-human_heart_cosmic_heart.mp3
3-human_heart_cosmic_heart.mp3
4-human_heart_cosmic_heart.mp3

NFO Filename becomes this:
00-uman_heart_cosmic_heart.nfo

I want NFO filename to become:
0-human_heart_cosmic_heart.nfo

Example Two:
01-human_heart_cosmic_heart.mp3
02-human_heart_cosmic_heart.mp3
03-human_heart_cosmic_heart.mp3
04-human_heart_cosmic_heart.mp3

NFO Filename become this (which is perfect):
00-human_heart_cosmic_heart.nfo

Example Three:
001-human_heart_cosmic_heart.mp3
002-human_heart_cosmic_heart.mp3
003-human_heart_cosmic_heart.mp3
004-human_heart_cosmic_heart.mp3

I want NFO filename to become:
000-human_heart_cosmic_heart.nfo

And want to make only one NFO file per directory.


#6

So perhaps this does it:
%_folderpath%$regexp(%_filename%,\d+-(.*),00-$1).nfo


#7

Thanks, gonna try it now. Will reply back. :slight_smile:


#8

Thanks for your time again. But its giving nfo file that starts with 00 in all the cases.

I want nfo file to start with:
0 when only 9 songs in the directory i.e. 1-9 tracks (single digit)
00 when upto 99 songs in the directory i.e. 01-99 tracks (double digit)
000 when upto 999 songs in the directory i.e. 001-999 tracks (triple digit)


#9

Sorry - I for some reason I thougt it was alsways 2 digits and sometimes 3.
So here we go for the next attempt:

%_folderpath%$num(0,$sub($strstr(%_filename%,'-'),1))-$regexp(%_filename%,\d+-(.*),$1)


#10

Worked. Awesome. Thanks a lot. Solved.