Home Render list in ordered structure without unicode characters
Reply: 0

Render list in ordered structure without unicode characters

user1244
1#
user1244 Published in April 27, 2018, 6:53 am

I have a list that looks like this:

[(u'Element1', u'Description1', u'Status1), (u'newElement2', u'newDescription2', u'newStatus2), (u'nextElement3', u'nextDescription3', u'nextStatus3), (u'anotherElement4', u'anotherDescription4', u'anotherStatus4)] 

I have an ansible playbook that uses a jinja2 template to render the list to a text file. The template file looks like this:

{% for item in description | batch(3, ' ') %}
{% for el in item %}
{{ el }}
{% endfor %}
{% endfor %}

But this returns the text file to look like this:

[u'Element1', u'Description1', u'Status1]
[u'newElement2', u'newDescription2', u'newStatus2]
[u'nextElement3', u'nextDescription3', u'nextStatus3]
[u'anotherElement4', u'anotherDescription4', u'anotherStatus4]

What I want the report to look like is this:

Element1           Description1           Status1
newElement2        nextDescription2       newStatus2
nextElement3       nextDescription3       nextStatus3
anotherElement4    anotherDescription4    anotherDescription4

Is there a way to remove the unicode characters and render the lists this way?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.314108 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO