LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save tree structure to text file and load textfile to another tree control

I'm able to save the structure and data to a text file, thanks to the "save tree structure to textfile" info found on this msg board, but can't seem to load the complete tree structure data from the text file into another tree. I've only been able to load parent data but can't get the hierarchy of the tree with the indents and child data to work.

 

 

Thanks

0 Kudos
Message 1 of 6
(7,066 Views)

Hi Rick2045,

 

Could you post a link to the example or discussion thread that helped you save the data? Could you also post what you've tried so far?

 

Thanks!

 

Regards,

Tanya Visser
National Instruments
LabVIEW Group Manager
0 Kudos
Message 2 of 6
(7,046 Views)

Hi Tanya,

 

I've solved part of my initial problem(see attached)...

 

Now the fun part!!!...How do you save/load (from textfile) multiple columns of a tree structure as shown in the jpg?

 

http://forums.ni.com/ni/attachments/ni/170/228320/1/tree%20pic.jpg

 

 

Thanks

 

Rick

0 Kudos
Message 3 of 6
(7,016 Views)

Hi Rick,

 

Have you seen this community example: Programmatically Populate a Tree Control ? It shows how to use property nodes to populate a tree control.

 

How to get the data from your text file and write it to the property nodes would depend on how your data is organized in the file.

 

Hope this helps!

Tanya Visser
National Instruments
LabVIEW Group Manager
0 Kudos
Message 4 of 6
(6,996 Views)

Thanks Tanya,

 

However, I'm still stumped on how to copy (from text file) to other columns in the tree (from one tree to another).  I can only get the first column to load.

 

I've attached my working VI and a textfile that I use to load into the "User list" tree.

 

Rick

 

 

Download All
0 Kudos
Message 5 of 6
(6,945 Views)

I solved the problem!!..Perseverance payed off!!

 

All that was required was to take the remaining data from the other columns (which was saved to text file) out of the Index Array and Build Array (each column as inputs) and connect the output to the Child Text of the Edit Tree Item. Add Item to End.

 

Works like a charm...can save tree structure "tree" to text file (including columns) and load to another tree "User List"

0 Kudos
Message 6 of 6
(6,930 Views)