I’ve building a string using python then writing that string into a string tag.
In building the string I am attempting to add line feeds/carriage returns using the ‘\r\n’ escape characters.
What I actually see in the string tag is a space where there should be a new line.
So the code looks something like this:
myStr = '' for i in range(1, 10): myStr += 'This is line ' + str(i) + '.\r\n' resp = system.tag.write('myStrTag', myStr)
If I run this is the Script Console with a print statement at the end I see the output as:
When I look at the content of the string I see this:
This is line 1. This is line 2. This is line 3. This is line 4. This is line 5. This is line 6. This is line 7. This is line 8. This is line 9.
This string will get written to a text field in a database table and is NOT written to a file. Is there anyway to format the string so that when it is written to the table the formatting is correct?