When using a FileOpen or FileList control in Linx, and you receive a Full File Path, in some instances you’d like to extract the File name from the File path. Thus you can use an SQL query, with the input of the Full path:
DECLARE @full_path varchar(max)
Select @Full_Path = @{OpenGenerateFile.File.FilePath}
SELECT LEFT(@full_path, LEN(@full_path) - CHARINDEX('\', REVERSE(@full_path))) as NameOfFolder,
RIGHT(@full_path, CHARINDEX('\', REVERSE(@full_path)) - 1) as NameOfFile
For example, if {OpenGenerateFile.File.FilePath} was “C:\Linx\BB\Export.csv” then the result will be:
NameOfFolder: “C:\Linx\BB”
NameOfFile: “Export.csv”