Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Randomize1978
Contributor II
Contributor II

"For each" issue

Hello everyone,

i have a problem and will be glad to get your assistant.

i need to  load 5 excel files(one sheet each) where i need to bring every week the latest file for each one of them/

one is for Budget with a unique name and 4 for each team.

what i planned to do was to run" for each in file list" and concatenate between them.

the budget is working,my problem is the other 4.

the files name is like this "businessteams 02062020-094512 team1.xlsx"

they all start with "businessteams " with date and time in the middle but ends with team number.

now,in the budget the start of the string is uniqe so i wrote 

FOR EACH file in FileList('$(vFilePath)\Weekly budget*.xlsx') and it works fine but here i cannot found a solution to retrieve the last file for each time as the team number is in the end of the string(tried FOR EACH file in FileList('$(vFilePath)\*team1.xlsx')

hope its clear and will be glad to get your help ,

thanks!

 

1 Solution

Accepted Solutions
raji6763
Creator II
Creator II

hi @Randomize1978 ,

you can load the 4 files without using for each statement.

All team filename start with businessteams so try the below:

raji6763_1-1592548518902.png

raji6763_2-1592548596944.png

 

the * will pull your all 4  files

 

Regards,

raji

View solution in original post

4 Replies
raji6763
Creator II
Creator II

hi @Randomize1978 ,

  • could you please try this?they all start with "businessteams " with date and time.so you can use businessteams*.xlsx    instead of *team1.xlsx 

(tried FOR EACH file in FileList('$(vFilePath)\*team1.xlsx') 

  • did you try with next file syntax

 

regards,

raji

Randomize1978
Contributor II
Contributor II
Author

hi @raji6763 ,

thanks, can you please elaborate?

when i write businessteams* it is not working maybe because there are 4 files that fetched from that.

can you please show me how to do it in the script?

raji6763
Creator II
Creator II

hi @Randomize1978 ,

you can load the 4 files without using for each statement.

All team filename start with businessteams so try the below:

raji6763_1-1592548518902.png

raji6763_2-1592548596944.png

 

the * will pull your all 4  files

 

Regards,

raji

Randomize1978
Contributor II
Contributor II
Author

thank you!