LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from and Consume part of config file

I'm in a difficult position... my predecessor arranged the format of a product specification input file (attached below). It is set up like a config file, which will make reading in each set of values very easy. Unfortunately, the 'section' labels are part of the data, which means I will not know the name of the section before hand.
 
Also, the file is a list of similar sections, and I need to read in each one, one at a time, based on user input. The file will be updated each day with new values, so I can consume what I read, but I don't know how to do that while taking advantage of the read config file VI.
0 Kudos
Message 1 of 5
(3,001 Views)
You do have the function called Get Section Names and this returns an array of strings. If you simply want to read in all sections, put the Read key inside a for loop. Wire the section names from outside the for loop to the Read Key input inside the for loop. A for loop will autoindex any array input.
0 Kudos
Message 2 of 5
(2,984 Views)
That does help, but I'm not reading in the entries all at once. The program will never be shut down, and the data file that I am reading will be updated periodically (I'm assuming once a day, but I really don't know). I can read in the first section name and use that to access the data, but I need a way of programatically deleting the data after i read it in.
0 Kudos
Message 3 of 5
(2,973 Views)
Look a little closer at your palette and turn on context help. Do you see the function called Remove Section? That does exactly what it says it does - removes the section and it's keys.
Message 4 of 5
(2,967 Views)
... and in LV6.1, you need to wire a "True" to Close Config Data to save the changes to file.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
Message 5 of 5
(2,958 Views)