- Posts: 189
- Thank you received: 9
etltools.SetVariable / GetVariable seems to be adding a space
- daniel.fung@xerox.com
- Topic Author
- Offline
- Elite Member
-
Less
More
4 years 6 months ago #19023
by daniel.fung@xerox.com
I am using the etltools import for python as follows and there is a space that is appearing after etltools.GetVariable call.
The results are shown below
Information 3/24/2019 9:01:57 AM Preparing to execute: Test 1
Information 3/24/2019 9:01:57 AM Started
Information 3/24/2019 9:01:57 AM Executing:Test 1
Information 3/24/2019 9:01:57 AM Executing Set Variable:Set Variable
Information 3/24/2019 9:01:57 AM Success
Information 3/24/2019 9:01:57 AM Executing Script:Script
Information 3/24/2019 9:01:57 AM import etltools
Information 3/24/2019 9:01:57 AM Executing:Script
Information 3/24/2019 9:01:57 AM name = >daniel<
Information 3/24/2019 9:01:57 AM length of name : 6
Information 3/24/2019 9:01:57 AM name from variale > daniel<
Information 3/24/2019 9:01:57 AM length of name from variable : 7
Information 3/24/2019 9:01:57 AM Success
Information 3/24/2019 9:01:57 AM Executing Set Variable:Set Variable
Information 3/24/2019 9:01:57 AM Success
Information 3/24/2019 9:01:57 AM Finished
Code:
import etltools
name = 'daniel'
etltools.WriteToLog('name = >' + name + '<' )
len1 = str(len(name))
etltools.WriteToLog('length of name : ' + len1)
etltools.SetVariable('<MyName>',name)
name_get=etltools.GetVariable('<MyName>')
len2 = str(len(name_get))
etltools.WriteToLog('name from variale >' + name_get + '<')
etltools.WriteToLog('length of name from variable : ' + len2)
Result.Value = 1
The results are shown below
Information 3/24/2019 9:01:57 AM Preparing to execute: Test 1
Information 3/24/2019 9:01:57 AM Started
Information 3/24/2019 9:01:57 AM Executing:Test 1
Information 3/24/2019 9:01:57 AM Executing Set Variable:Set Variable
Information 3/24/2019 9:01:57 AM Success
Information 3/24/2019 9:01:57 AM Executing Script:Script
Information 3/24/2019 9:01:57 AM import etltools
Code:
import etltools
name = 'daniel'
etltools.WriteToLog('name = >' + name + '<' )
len1 = str(len(name))
etltools.WriteToLog('length of name : ' + len1)
etltools.SetVariable('<MyName>',name)
name_get=etltools.GetVariable('<MyName>')
len2 = str(len(name_get))
etltools.WriteToLog('name from variale >' + name_get + '<')
etltools.WriteToLog('length of name from variable : ' + len2)
Result.Value = 1
Information 3/24/2019 9:01:57 AM Executing:Script
Information 3/24/2019 9:01:57 AM name = >daniel<
Information 3/24/2019 9:01:57 AM length of name : 6
Information 3/24/2019 9:01:57 AM name from variale > daniel<
Information 3/24/2019 9:01:57 AM length of name from variable : 7
Information 3/24/2019 9:01:57 AM Success
Information 3/24/2019 9:01:57 AM Executing Set Variable:Set Variable
Information 3/24/2019 9:01:57 AM Success
Information 3/24/2019 9:01:57 AM Finished
Please Log in or Create an account to join the conversation.
- daniel.fung@xerox.com
- Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 189
- Thank you received: 9
4 years 6 months ago - 4 years 6 months ago #19024
by daniel.fung@xerox.com
Replied by daniel.fung@xerox.com on topic etltools.SetVariable / GetVariable seems to be adding a space
of course i can add a .strip() on the value after calling etltools.GetVariable(), but this is not a good solution.
import etltools
import etltools
Code:
name = 'daniel'
etltools.WriteToLog('name = >' + name + '<' )
len1 = str(len(name))
etltools.WriteToLog('length of name : ' + len1)
etltools.SetVariable('<MyName>',name)
name_get=etltools.GetVariable('<MyName>')
name_get = name_get.strip() ## this is the strip call.
len2 = str(len(name_get))
etltools.WriteToLog('name from variale >' + name_get + '<')
etltools.WriteToLog('length of name from variable : ' + len2)
Result.Value = 1
Information 3/24/2019 9:10:38 AM Executing:Script
Information 3/24/2019 9:10:38 AM name = >daniel<
Information 3/24/2019 9:10:38 AM length of name : 6
Information 3/24/2019 9:10:38 AM name from variale >daniel<
Information 3/24/2019 9:10:38 AM length of name from variable : 6
Information 3/24/2019 9:10:38 AM Success
Information 3/24/2019 9:10:38 AM Executing Set Variable:Set Variable
Information 3/24/2019 9:10:38 AM Success
Information 3/24/2019 9:10:38 AM Finished
Last edit: 4 years 6 months ago by daniel.fung@xerox.com.
The following user(s) said Thank You: admin
Please Log in or Create an account to join the conversation.
4 years 6 months ago #19026
by admin
Mike
ETL Architect
Replied by admin on topic etltools.SetVariable / GetVariable seems to be adding a space
Thank you for the feedback. We will have a look at it for you.
Mike
ETL Architect
Please Log in or Create an account to join the conversation.
4 years 6 months ago #19031
by admin
Mike
ETL Architect
Replied by admin on topic etltools.SetVariable / GetVariable seems to be adding a space
Status update: We have reproduced the problem
Mike
ETL Architect
Please Log in or Create an account to join the conversation.
4 years 6 months ago #19036
by admin
Mike
ETL Architect
Replied by admin on topic etltools.SetVariable / GetVariable seems to be adding a space
Hi Daniel
The issue you reported was corrected in the latest release
The issue you reported was corrected in the latest release
Mike
ETL Architect
Please Log in or Create an account to join the conversation.