When writing to a file whitespace is added between every line in the file. Tried using .strip()
to remove the whitespace:
newstring = (mytemplate.render(identifiers=zipped_list))
print (newstring)
When the content is read into string newstring it will look like:
<headers>
<universe>Default</universe>
<domain>Instrument</domain>
<universeOperation>Update</universeOperation>
<acquisitionOperation>None</acquisitionOperation>
<manufactureOperation>None</manufactureOperation>
<publicationOperation>None</publicationOperation>
<businessDate>2017-06-13</businessDate>
</headers>
<items>
<item>
<identifiers>
<ID_BB_GLOBAL>TEST1234</ID_BB_GLOBAL>
</identifiers>
<classifiers>
<CL_SUBSCRIBER>TEST</CL_SUBSCRIBER>
<CL_STRATEGY>TEST</CL_STRATEGY>
</classifiers>
When I write the string to a file:
file = open(FILE_PATH + "Test.xml", "w")
file.write(newstring)
it will look like this:
<headers>
<universe>Default</universe>
<domain>Instrument</domain>
<universeOperation>Update</universeOperation>
<acquisitionOperation>None</acquisitionOperation>
<manufactureOperation>None</manufactureOperation>
<publicationOperation>None</publicationOperation>
<businessDate>2017-06-13</businessDate>
</headers>
<items>
<item>
<identifiers>
<ID_BB_GLOBAL>BBG0016RLJ79</ID_BB_GLOBAL>
</identifiers>
<classifiers>
<CL_SUBSCRIBER>SYS</CL_SUBSCRIBER>
<CL_REMOVE>N</CL_REMOVE>
<CL_STRATEGY>MAM_ID</CL_STRATEGY>
</classifiers>
How do I remove the whitespace between each line?