Description
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Notify Moderator
This macro uses python and os library to delete any given filepaths.
It is a good way to delete for example the *.bak files.
INPUT of filepaths to be deleted (example):
FilePath |
C:\...\Output.xlsx |
C:\...\SAPExtraction.txt |
C:\...\Report.pdf |
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
Thanks a lot ! This allows me to delete the .bak files 👍
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
Would it be possible for you to show how you do the process inside of Alteryx with a screenshot ? I am unable to update to a newer version and therefor cannot use this workflow. Thanks for any help you can provide.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
Hi @WorleyT
Download the workflow, and instead of trying to open it, extract it.
Then go to the macro, open it and save it again.
Then come back to the main workflow
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
Hi Feli
When I try to run the workflow, I'm getting the below error
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
1-Inside of your python tool, change the kernel for the one available for you
2-restart the kernel
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
Now I'm getting the permission issue error, what would be the reason any idea
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
@dineshbabu2811 after saving the macro with the correct kernel, go to the main workflow and be sure to provide valid filepaths to it, and be sure that the user that is running the workflow have the permissions to do it.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
Works very well, and simple to set up.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
Hey @Felipe_Ribeir0 , I downloaded and followed steps but I must be missing something.
Am I supposed to put file path that I want to target in all inputs in both the MC_Removefiles and Removefiles workflow where it says path and directory?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
Hi @sammyb84
You dont need to change anything inside of the macro, just provide the fullpath of the file to be deleted to the macro as input.
Maybe taking a look at these videos can help you to understand how it works:
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
Hi @Felipe_Ribeir0 ,
I did provide fullpath of the file to be deleted, but which workflow am I inserting it into. I provided screenshots showing where I inserted the full path but it still not working.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
Hi Felipe,
I'm trying to use the macro you provided and to delete the file only have no data.
My data sample are:
DistributorCode | ItemCode | ItemDesc | ErrorMessage | ProcessTimestamp |
A# | 1101324002 | NEXU 25KG | Missing Item Code in Table Product Mapping | 6/27/2024 11:42 |
A# | 1101324002 | NEXU 25KG | Missing Item Code in Table Product Mapping | 6/27/2024 11:42 |
DistributorCode,ItemCode,ItemDesc... are my column
if data exist the flow will run to downstream(other tool, file not deleted),
if no data(having column only consider as no data), the file will be deleted:
I adjust the Jupyter notebook:
//// end code
Then, at the filepaths Input)inside REMOVEDFILES. yxmd i put full path to my excel file( path....\excel.xlsx)
So how can i achieve this
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Notify Moderator
excellent thanks. Now that the BAK doesn't self delete half as much as it used to.