Adding line breaks to data export (stream to CSV or similar)

I found a number of posts regarding importing data from CSV but I’m looking for more control exporting (stream). More like creating a table, but if I can get close with CSV that can be good enough. I’m working on a Mac so Lunchbox Excel and DataTable components don’t work.

I’d like to:

  1. Put list data with same row # on the same row, as opposed to automatic line break after each list item.
  2. Have list data with same “col” aligned in their own column, as opposed to all in the same column.
  3. If possible, add an extra line break after one datum to make it appear underneath, as opposed to the right of, the preceding datum.

For 1, perhaps splitting list by conditional statements? Still learning…

For 2, is there a way to do this with Matrix, and then to CSV?

For 3, I tried inserting various escaped characters but they were all interpreted as text (e.g. \n, “\n”, , “”)

Screenshots show desired outcome, although doesn’t need to have fancy formatting, just the right order so I can copy and paste from one sheet to the other.

CSV export test.gh (10.1 KB)

Thanks!

CSV export_RE.gh (22.6 KB)

Just reread your post and added extra line break, if it is of any help…

CSV export_RE.gh (22.5 KB)

1 Like

Amazing, thank you so much! Still studying how you did it.

This definitely does the job, although quite complex. I’d be curious if anyone knows of (Mac) plugins to ease this kind of work in the future…

Either it should be rethinked how you got your original data and do your pre-processing differently or if somebody can write a custom code for it.

But, who knows, there are gurus on this forum. Maybe they have some scripted solution…