Split text for using as Order

Hi.
I have a file name [File Name] which are names of images. All the images have a counter in them:
Example

587446-001.jpg
587446-002.jpg
587446-003.jpg

452114-001.jpg
452114-002.jpg
452114-003.jpg
452114-004.jpg
452114-005.jpg

And so forth. I need to extract the 3 characters in front of the ‘-’ and before the ‘.’ so i end up with:

001
002
003
004 etc

I can then use that as a number and set the Order by that numeric value in either Asc or Desc.
This would have to be a Virtual Column.
Can someone help with extracting the value from the file name please.

Kind Regards

Solved Solved
0 5 213
1 ACCEPTED SOLUTION

Bahbus
New Member

INDEX( SPLIT( INDEX( SPLIT([File Name], "-"), 2), "."), 1)

View solution in original post

5 REPLIES 5

Bahbus
New Member

INDEX( SPLIT( INDEX( SPLIT([File Name], "-"), 2), "."), 1)

Wow quick answers. I tried Dave’s version, it works fine and thanks to both of you guys.

Merry Christmas.

MID(
    [ColumnName],
	(FIND("-",[ColumnName])+1),
	3
)

OR

MID(
	[ColumnName],
	FIND("-",[ColumnName])+1,
	(FIND(".",[ColumnName]) - (FIND("-",[ColumnName])+1))
)

Boss 3X_d_5_d51363a862e7ab883241c312ac5d7f271579cdd3.gif

Top Labels in this Space