For a conversion of AccountView XML input files to XML Auditfile Afrekensystemen (Cash Registers) I need to generate an output file name without a path. The query is:
select f.file_path file_path_src
, replace(f.file_path, '.xml', '.xaa') file_path_tgt
, xmltransform(cnt.file_contents, xsl.file_contents) xaa_contents
from files('${rootpath}\input', '*.xml')@os f
join read_file_text(f.file_path)@os cnt
on 1=1
join read_file_text('${scriptpath}\convert-account-view-to-xaa.xsl')@os xsl
on 1=1
local export documents in xaa_contents to "${rootpath}\output" filename column file_path_tgt
However, the local export documents
statement requires the file name to consist solely of the base name and the extension. When you include directory structure in it, it will generate funny file paths like <root path>\c_\folder\...
.
How do I extract the name of the file without directory path and without extension from f.file_path
?