Stuck a bit, can someone help me finish this flow. I basicallly want to move the files from one folder to another based off the file names identified in the excel document. I can grab the current item in the excel file but I just dont know how to match it against the files in the folder and then move them. Any help someone can offer?
The exel file has just one column.
Solved! Go to Solution.
Move Files should be %CurrentItem1% (this is the full path and Filename with extension) to %CurrentItem0[0]%. (The folder code, but you also need the rest of the address in front ex. C:\Clients\%CurrentiItem0[0]%
Ah apologies, should've mentioned that, its written like this inside %""% this causes it to get rid of any null characters, as "%""%" is the way PAD interprets null characters.
Apologies for the late reply, this is some what weird, the only reason I can come up for this is that the file names in excel has like a space / white space at the end of the name, you could try using another replace before the first one and regexing for just "\s" in the excel names which is the whitespace char, and then replacing it with %""% for null. See if that works.
If that is the case as suggested by @Pavel_NaNoi then use the string function to remove any unwanted characters.
I tried that as well. I have no idea why it is not doing a compare. Anything else I can try?
@VJR can you do a mock up of the solution you provided. I could not get yours work as well. Sorry guys I am just too new and struggling.
I figured it out..I think I had a space before the "%Files% \". that was part of the issue. I removed the trims and it works! Thank you guys for being so patient with me. I think bottom line was I had to struggle with this. Thanks for pushing me!
We need to do a zoom call on this, cuz we can get something faster for you.
For now, use %CurrentItem[1]%; this is the Filename in the current row of Excel. %CurrentItem[0]% is the folder code.
you need two loops
For Each %CurrentFile% in %Files%
For Each %CurrentItem% in %ExcelData%
if %CurrentItem[1]% = %CurrentFile.Name%
Move %CurrentFile% to ‘whatever address using %CurrentItem[0] for the folder code
Exit (For Each), we don’t need to keep looking through Excel if we found a match.
End IF
End For Each
End for each
good luck
- Launch Excel
- Read From Excel
- For Each
End
The "IF" is just an example. You can skip it if you don't need.
Cannot get this one to work:
Your move file does not show full file name and extension.
While moving please add full path with file name and extension.
Append it to the Excelvalue.
Michael I am missing something. Please tell me if I have not provided enough data.
Move Files should be %CurrentItem1% (this is the full path and Filename with extension) to %CurrentItem0[0]%. (The folder code, but you also need the rest of the address in front ex. C:\Clients\%CurrentiItem0[0]%
What did I mess up?
Here's a much more clever way of doing this, it will save you minutes as you won't even need a for loop:
Use the comments in the image to follow along, but what this basically does is it finds the beginning of a line inside each of the pdf names from the excel file then gives them the file path of the folder housing the .pdf files on your PC, splits them into a list and matches it with the list from the "Get files in folder" action, after which it only moves the matched files.
Hope this helps, feel free to ask anything else if you're stuck.
I am not having the greatest day today as I cannot get any of these solutions to work. This is definitely a user error, just need to buckle down and figure this out.
I am having a hard time reading the Remove item from list. What is the character after "Remove all occurrences of item ..
Ah apologies, should've mentioned that, its written like this inside %""% this causes it to get rid of any null characters, as "%""%" is the way PAD interprets null characters.
Still Struggling. cannot get it to work. I notice for example file Claringbold matches but its not picking it up in intersection list. I know its something silly that I am not paying attention to.
Apologies for the late reply, this is some what weird, the only reason I can come up for this is that the file names in excel has like a space / white space at the end of the name, you could try using another replace before the first one and regexing for just "\s" in the excel names which is the whitespace char, and then replacing it with %""% for null. See if that works.
If that is the case as suggested by @Pavel_NaNoi then use the string function to remove any unwanted characters.
I tried that as well. I have no idea why it is not doing a compare. Anything else I can try?
@VJR can you do a mock up of the solution you provided. I could not get yours work as well. Sorry guys I am just too new and struggling.
I figured it out..I think I had a space before the "%Files% \". that was part of the issue. I removed the trims and it works! Thank you guys for being so patient with me. I think bottom line was I had to struggle with this. Thanks for pushing me!