Hello there,
I have a several files with filenames like :
myfirstsong-CT_V06.mp3
mysecondsong-CT_V04.mp3
mythirdsong-CT_V11.mp3
…
which the number is the version of the song and I need to extract this number to be displayed in my app without manually typing it in the data editor.
Is there a way to do it ?
Thanks
HTML
May 11, 2025, 5:39pm
2
You can use JavaScript column, paste this code there, and in p1 put your file name:
if(p1){
const match = p1.match(/_V(\d+)/);
if (match) {
const numberAfterV = match[1];
return(Number(numberAfterV));
} else {
return("No number found");
}
} else {return 'empty'}
You can also use the Extract Matching Text column for this.
If you want the leading 0.
_V(\d+)
This if you don’t want the leading 0.
_V(?:0(?=[1-9]))?(\d+)
HTML
May 11, 2025, 11:52pm
5
Yes, you can do that, but you won’t have control over errors, empty values, or missing numbers in the name. You’d need to add additional columns to handle those cases.
Ho yes ! That works too and it doesn’t need an if-then-else to filter the results
Thank you so much