# Log Userdata and Visualize it

**URL:** <https://forum.dynamobim.com/t/log-userdata-and-visualize-it/81750>\
**Category:** Revit\
**Tags:** python\
**Created:** [October 4, 2022, 7:43pm UTC](https://forum.dynamobim.com/t/log-userdata-and-visualize-it/81750 "2022-10-04T19:43:46Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![gerhard.p](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gerhard.p/32/147675_2.png) [@gerhard.p](https://forum.dynamobim.com/u/gerhard.p)\
**Post date:** [October 9, 2022, 8:52pm UTC](https://forum.dynamobim.com/t/log-userdata-and-visualize-it/81750/21 "2022-10-09T20:52:53Z")

</div>

Thanks jacob, will need a few days to recover from this defeat 😃 then I´ll post some files for testing.

The problem with the Dynamo nodes: If there is any error in the graph and the write node gets a null or an empty list it erases my whole log! Happend a few times now so i live in fear until i solved that problem^^

---

<div class="post-metadata">

**Author:** ![gerhard.p](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gerhard.p/32/147675_2.png) [@gerhard.p](https://forum.dynamobim.com/u/gerhard.p)\
**Post date:** [October 13, 2022, 10:30pm UTC](https://forum.dynamobim.com/t/log-userdata-and-visualize-it/81750/22 "2022-10-13T22:30:05Z")

</div>

Finally made it!

Found the solution on stack. The writer iterates over every single character, so the string must be “wrapped to a list” with writer.writerow([Line]).

[python - Why does csvwriter.writerow() put a comma after each character? - Stack Overflow](https://stackoverflow.com/questions/1816880/why-does-csvwriter-writerow-put-a-comma-after-each-character)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/0/f0b18be26928c1752ec30b3b18df418e01ddbf8b.png)

read:

```auto
import io

filePath = IN[0]

with io.open(filePath, "r", encoding="UTF8") as file:	
	string = file.read().splitlines()

OUT = string

```

write:

```auto
import io
import csv

filePath = IN[0]
NewLog = IN[1]

with io.open(filePath,"w", encoding="UTF8", newline='') as file:	
	for Line in NewLog:
		writer = csv.writer(file,delimiter="'")
		writer.writerow([Line])

```

[Previous page](https://forum.dynamobim.com/t/log-userdata-and-visualize-it/81750.md?page=1)
