Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: etltools.SetVariable / GetVariable seems to be adding a space

etltools.SetVariable / GetVariable seems to be adding a space 1 month 3 weeks ago #19023

I am using the etltools import for python as follows and there is a space that is appearing after etltools.GetVariable call.
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
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.

etltools.SetVariable / GetVariable seems to be adding a space 1 month 3 weeks ago #19024

of course i can add a .strip() on the value after calling etltools.GetVariable(), but this is not a good solution.

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>')

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
The following user(s) said Thank You: admin

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

etltools.SetVariable / GetVariable seems to be adding a space 1 month 3 weeks ago #19026

  • admin
  • admin's Avatar
  • Offline
  • Moderator
  • Moderator
  • Deeds not Words
  • Posts: 7510
  • Karma: 33
  • Thank you received: 409
Thank you for the feedback. We will have a look at it for you.
Mike

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

etltools.SetVariable / GetVariable seems to be adding a space 1 month 3 weeks ago #19031

  • admin
  • admin's Avatar
  • Offline
  • Moderator
  • Moderator
  • Deeds not Words
  • Posts: 7510
  • Karma: 33
  • Thank you received: 409
Status update: We have reproduced the problem
Mike

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

etltools.SetVariable / GetVariable seems to be adding a space 1 month 3 weeks ago #19036

  • admin
  • admin's Avatar
  • Offline
  • Moderator
  • Moderator
  • Deeds not Words
  • Posts: 7510
  • Karma: 33
  • Thank you received: 409
Hi Daniel

The issue you reported was corrected in the latest release
Mike

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

  • Page:
  • 1

We have 215 guests and 2 members online