Grasshopper

algorithmic modeling for Rhino

How do you remove <empty> entries within a list

I have a list that has the following content

275.3


234

3

I need to extract the three numbers so that they are consecutive and delete the empty lines.
What culling component do I need to use?

Views: 12264

Replies to This Discussion

Empty is text with length 0. You can use text length and cull with the resulting output as pattern the emptys.

best

alex

Many thanks. It works.

Under 'Sets | Tree' choose 'Clean Tree' component.  Change 'E (Remove Empty)' input from 'False' (default) to 'True' and connect your list to the 'T (Tree)' input.  The 'T (Tree)' output will have nulls and empty lines removed.  Not always necessary and may affect later operations that expect same-length lists.

i assumed he is working with a csv file (due to the lines description i guess), in which case clean tree does not do the job.

in such case to work with clean tree would need the following

but i try to avoid red components.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service