You can translate the question and the replies:

Delimited File sources with DateRange

Could someone provide an example which works for using Delimited Files with a date range in the file name (or path)? I have given up our own design for now, and I am currently trying to recreate the example from "Virtual DataPort Administration Guide" and even that is failing. Failing Example (copied right from the guide): /tmp/conflog^DateRange('yyyy/MM/dd',@startdate,@enddate,'yyyyMMdd') Error message (no matter how I try to rearrange the naming, directory, or format definition): Parse error ... '/tmp/conflog^DateRange('yyyy/MM/dd',@startdate,@enddate,'yyyyMMdd')': Error: could not match input
user
26-11-2014 18:31:26 -0500

10 Answers

I think your problem is related to the quotes used. You would have to use double quotes instead of simple quotes: E.g: C:/tmp/logs/conf_^DateRange("yyyy-MM-dd",@startdate,@endtdate,"ddMMyyyy").log But there is a known issue with DateRange that will be solved in the next official Denodo 5.5 update, so you will have to wait to start using it. Did you try the "Denodo Log Custom Wrapper" for reading logs?
Denodo Team
01-12-2014 09:57:11 -0500
Thank you! That got me past the "Parse" error. I am now dealing with "unparseable date". And thanks for the bug warning. I will avoid production release of this until the fix.
user
01-12-2014 12:45:28 -0500
Single quotes cannot be used in Date Range function which is the reason for error 'could not match input'
user
05-06-2019 17:08:30 -0400
Hi, Yes, your understanding is correct. You can use the Date Range function by using the double quotes instead of single quotes. Hope this helps!
Denodo Team
18-06-2019 07:58:32 -0400
Hi, I am raising this because official documentation is still bad. You have to reach to this answer to find the right way to do it.
user
29-01-2020 10:29:26 -0500
Hi, I was able to find the correct usage of DateRange function in the Delimited Files, that is, the literal parameters of the DateRange function surrounded by **double quotes** in the [Paths Using Date Ranges](https://community.denodo.com/docs/html/browse/7.0/vdp/administration/creating_data_sources_and_base_views/delimited_file_sources/delimited_file_sources#paths-using-date-ranges) section of Virtual DataPort Administration Guide. Hope this helps!
Denodo Team
12-02-2020 06:57:16 -0500
It does not seem to work ^DateRange("yyyy/MM/dd",@start_date,@end_date,"yyyyMMdd").log says no files . the files are available and (.*)\.log pattern works fine
user
26-08-2020 08:06:50 -0400
Hi, The file not found error usually occurs in case of incorrect file path or file pattern mentioned in the DateRange function. When I came across the files not found error, I checked if there is any mismatch between the file names and the [**Pattern**](https://docs.oracle.com/javase/8/docs/api/index.html?java/text/SimpleDateFormat.html) of the date range that I have specified in the DateRange function. For instance, to retrieve the content of files like **vdp-queries.log.2019-05-16**, I used the below format to successfully obtain the data: `vdp-queries.log.^DateRange(**"yyyy-MM-dd"**,@start_date,@end_date,"yyyy-MM-dd")` Additionally, you can ensure that there are no spaces between the parameters of the DateRange function. Hope this helps!
Denodo Team
04-09-2020 03:14:18 -0400
This still does not work. If I put such a file in my destination directory, the above gets me "invalid regular expression". Removing the `**` gets me back to where we started: `there are no files in ... matching the provided route pattern`
user
 Edited on: 19-10-2020 19:10:24 -0400
Hi, I faced the same error **there are no files in ... matching the provided route pattern**, when using the DateRange Function in the File name Pattern section. From the documentation, I could see that the [**File name pattern**](https://community.denodo.com/docs/html/browse/latest/vdp/administration/creating_data_sources_and_base_views/path_types_in_virtual_dataport/local_path#paths-pointing-to-a-directory) field accepts only regular expression. Hence, when using the interpolation variable and DateRange function in this section will not facilitate the expected results. For your scenario, you can define the entire file expression in the **File path** section like : > <path_to_the_folder>/vdp-queries.log.^DateRange("yyyy-MM-dd",@start_date,@end_date,"yyyy-MM-dd") **Note : **Make sure that the Date Pattern in DateRange function and dates that you give during execution matches with the files available in this directory. Additionally, if you still need help and if you are a user with valid support access then you can raise a support case in Denodo Support Site so that our support team can assist you. Hope this helps!
Denodo Team
02-11-2020 03:49:16 -0500
You must sign in to add an answer. If you do not have an account, you can register here