Is there a simply select statement usign a combination of string functions to pull out a filename from a directory listing?
xxxx\xxxx\filename.txt
The SUBSTRING_INDEX
function is ideal for this:
SUBSTRING_INDEX(myFileName, '\\', -1)
The last argument of -1
says to return everything after the last \
. Note that you have to escape the \
as \\
.
There's a working SQL Fiddle here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With