You can translate the question and the replies:

Get latest excel file from a folder in excel datasource

Hi We have created a delimited datasource to fetch details from latest excel file in the folder in server. We have a job which will create new files everyday in this folder. We need to fetch the latest file daily by the datasource we are creating. Is there any possibility to do this?
user
29-09-2023 04:14:28 -0400
code

1 Answer

Hi, To fetch the latest files written via Denodo Scheduler export job through a data source, I followed the below steps: **1.**I assumed that the file name format is “everyday_25_10_2023.xlsx” **2.**In the Denodo Virtual DataPort admin tool I created a new data source by clicking on File > New > data source > Delimited File. **3.**Then in the configure section I provided the File path as ”<CSV_EXPORT_FOLDER>@filename” and saved the Datasource. **4.**Next I created a base view by clicking on ”create base view” option in the newly created datasource and to test the connection, I provided a file of the same format as the export file **5.**Then created a derived view over base view using the query "create view <derived_view_name> as select <columns> from <base_view_name> where "filename"=concat('everyday',formatdate('_dd_MM_yyyy',current_date),'.xlsx')" **6**.Every time I execute the derived view, I am able to get the data from the latest file. Hope this helps!
Denodo Team
04-10-2023 09:16:59 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here