Grasshopper

algorithmic modeling for Rhino

I am reading in an XML file with a repeating data structure. If I read it into a GH component it thinks it's a list of x strings, one for each data block? Does that sound correct? If so, is there any way around that?

Views: 385

Replies to This Discussion

Hi Matthew,

 

if you use the ReadFile component then it will indeed split the file up into loose lines. Sounds like you need to do some custom xml parsing. You can either load the file directly inside a VB (or C#) component and parse the contents there, or you can use the Readfile component and load the entire file into a single string, then parse that string. The benefit of the latter approach is that you'll get automatic updates when the file changes.

 

--

David Rutten

david@mcneel.com

Delft, NL

Thanks David. I'll look at those options.

This is a scripted CSV parser as an example:

 

http://www.grasshopper3d.com/forum/topics/file-parser

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service