Split filename into two variables

How to split filename into two variables

A task has a name of 'abc_123.txt'

I would like the folder name to be the prefix of the filename prior to the "_" delimiter 'C:\abc'.

File 123.txt will then be placed inside C:\abc\123.txt

Task Category:

Functions (Basic)