Dynamic Rename - How to rename extension?

More
1 year 8 months ago #24520 by prashant
HI,
In continuation of my previous question , I have a file location defined in 
#EName# containing value

C:\Users\Superadmin\Documents\KBIAutomation\eomaterial\input\eomaterial.csv

I wish to rename this to eomaterial.xlsx


 
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago #24525 by admin
In this case you have to use calculated parameter.



begin
 Result:=ChangeFileExt(GETVARIABLE('#EName#'),'.xls');
end;

Mike
ETL Architect
The following user(s) said Thank You: prashant

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago #24526 by admin
I have attached the package for your convenience

File Attachment:

File Name: package.zip
File Size:1 KB


 

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago #24531 by prashant
Thank you Pascal for the win , my python script here kept failing 
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago #24532 by admin
Please let us know if you find the way to do the same using python. We will add it to the documentation.   

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago - 8 months 11 hours ago #24542 by prashant

Please let us know if you find the way to do the same using python. We will add it to the documentation.   
Team Pascal has cheated , some bug somewhere irrespective of what I try , I get the same error 

Following Error happened: Could not convert variant of type (UnicodeString) into type (Boolean) . Loop work once and fails
Code:
Result.value = etltools.GetVariable('#email_now#')[:-3] + 'xlsx' OR from pathlib import Path Result.value = str(Path(etltools.GetVariable('#email_now#')).with_suffix('.xlsx'))
Last edit: 8 months 11 hours ago by admin.

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save