Hello,
I would like to change a file extension from .zip to .pptx using a python tool in Alteryx.
i.e. "MODIFIED.zip" to "MODIFIED.pptx".
Here is the script:
from ayx import Alteryx
import os
from pathlib import Path
directory = ('C:/Temp/PowerPoint test/DELETE_modified/DELETE_original/')
for f in Path(directory).rglob('.zip'):
f.rename(directory + f.stem + '.pptx')
The script runs successfully, but zip file stays the same.
Solved! Go to Solution.
Hi @knozawa
I'm not overly familiar with Python. Perhaps consider renaming the file extension with a batch script...
Thank you @HomesickSurfer & @danilang !
I updated my script and it successfully updated the extension from .zip to .pptx.
from ayx import Alteryx
import os
directory = ('C:/Temp/PowerPoint test/DELETE_modified/DELETE_original/')
os.rename('MODIFIED.zip', 'MODIFIED.pptx')