Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Python script

How do I set a delimiter within a variable in a python script: ( this script is under an iterator with many (jobsname) and (rowcount) I want every jobname and rowcount to have its own line.

new_agg_var1 = str(pythonvar) +' ' + str(JobName) + ' ' + str(rowcount)+ ','

context.updateVariable('pythonvar', str)

3 Community Answers

Matillion Agent  

David Lipowitz —

Hi Maurizio,

I was able to find following reference through Google:

Python Join Examples

Hope that helps.

Best Regards,
Dave


Maurizio Heller —

But I want to insert it into an SNS message in that format.


Matillion Agent  

David Lipowitz —

Hi Maurizio,

Based on the reference I forwarded, you can construct a string by joining together the elements of a list using the .join method of the delimiter of your choice. For example:

values = ['a', 'b', 'c']
print '-'.join(values)

prints

a-b-c

So if you put the values you want to join together in a Python array, you can join them using the same approach.

Best Regards,
Dave

Post Your Community Answer

To add an answer please login