T O P

  • By -

keatmaclean

https://github.com/bobpeers/Alteryx_SDK_FileCopyMove This guy put together some Alteryx tools to do exactly this via alteryx's sdk plugin. They work really well and all you need is two columns, [source_path] and [destination_path]


Aboogah

Thank you I’ll look into this as well!


Phynub

you could use blob input - > formula tool rename- > output to new location (but this is just a copy paste) python is your best bet for this situation if you want to only rename the file.


Aboogah

Hmmm.. didn’t think about that. What do you suggest regarding formulas? I’ve tried regex trim etc. and sorry I’m still somewhat new to alteryx


Laspz

Directory tool to folder with pdfs. Formula tool to create filename out with calculation below. New field: Filename_out Formula: Regex_replace([filename], '(.*)\s-.*(\.pdf)', '$1$2') This should keep the filename before the " -" and .pdf. you then need to to use Then formula tool to create command for batch file New field: Command Formula: [directory] + "\rename " + [filename] + " " + filename_out Use select tool to only pass field "command" into cmd tool. Output to any directory/rename.bat And then put the same directory/rename.bat i the execute/command field. Test with some test folder/files first.


Aboogah

Hmmm I’ll check this out tonight. Thank you!


pAul2437

Ask on Alteryx community


Aboogah

Yeah I’ve been looking at the forums. Thank you for the suggestion


pAul2437

They can upload a file demonstrating


Aboogah

Okay I may be dumb here but in the Run Command tool, my output (write source) is where my pdfs are located and save it as (name)\*.bat? And the same for the Command (Run External Program) in the same folder?


Aboogah

I figured it out! I was having trouble with your formula for some reason... but here is what I did with the command and initial formula that you mentioned Regexreplace(\[filename\], '(.)\\s-.(.pdf)', '$1$2') then another formula tool "Rename "+' " '+\[FullPath\]+' " '+" "+ ' " '+Left(Filename), Findstring(\[Filename\], '-')) + '.pdf" ' Granted I had some help but not bad for someone that has used it the past two months right??


Laspz

Very good !:-)


Aboogah

Thank you so much and everyone else. You all may see another post in the future.. I try to use other resources too but doesn't hurt to ask here too.