Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_n
Contributor
Contributor

how to provide dynamic file name to fetch the file from azure blob??

Please let me know how to give file name if tazurestroageList_1 . it should pick the file name with the pattern. 

 

Eg: filename

123_612673id778_student_plan_2018-20-08.csv

 

everytime 

123_612673id778 and 2018-20-08 will be changing..

Student_plan is constant.

how can i pick the file from the lis in blob.

 

Please find the below screen shot.

 

Let me know how to provide in the bob filter prefix.

 

 

Labels (6)
16 Replies
amit_n
Contributor
Contributor
Author

by using the below code m getting the file name.

 

String blobName = input_row.BlobName;

if(blobName.matches("(?i).*_student_plan_.*")) {
System.out.println(blobName);
}

 

i have connected to thecontainer from tAzureStorage_list. In this container there is a folder called model_outputs in that there are multiple file.

Here i have to achive pick the lastest file from folder model_output and store that latest file with the matching file to the local folder by connecting to TasureStorageGet.

 

how can i achive this.. Your solution is helping a lot. Please let me know how to achive it.

 

 

 

iamabhishek
Creator III
Creator III

What would be the meaning of latest file, two blobs with same name couldn't exists under one directory in a container.
Your original question was for filter blobs based on name pattern - if that has been achieved request you to mark the post as accepted solution and start another topic with the new & correct question.
Kudos are always welcome.
amit_n
Contributor
Contributor
Author

No .. I need to pick the file with the name patter from the azure blob under the container there is a folder model_outputs. Inside the folder files will the available .Based on the filepatter we need to get and store it to local.

iamabhishek
Creator III
Creator III

In that case the solution is already provided.
amit_n
Contributor
Contributor
Author

the file is reading with the folder name.

how can i remove the folder name. currrntly file nam reading as mode_outputs/266363_*.csv

how to remove the model_outputs/ folder name in the code????

iamabhishek
Creator III
Creator III

Use like this - 

String foo = "model_outputs/266363_*.csv";
System.out.println(foo.substring(foo.indexOf("/") + 1));

If you have multiple "/" in your blob filename then would suggest to use this - 

 

String foo = "model_outputs/output/266363_*.csv";
System.out.println(foo.substring(foo.lastIndexOf("/") + 1));

Please mark the topic as "solution provided" if the reply has helped you. Kudos are also welcome 🙂

amit_n
Contributor
Contributor
Author

I am using the code which u have given above. i need to capture only the file name and assign it to the context variable after splinting the folder and filename.

find the attached screen shot.

 context.p_filename and pass the file name to tfileinputdelimiter.

 


Capture5.JPG