LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Read array from .ini file

 

The file is no ini file (although "ini file" is not a standard), so no ini file\config file reader will be able to deal with it.

 

I'd use Spreadsheet String To Array, with a 1D array of strings as input. Then, in a for loop, iterate over all the lines. Or maybe a 2D array as input, and "=" as separator. Then for each line check if it begins with menu or submenu, and store it in your own structure (in a class) or in a "real" ini file.

 

This basically gets you a converter, that's executed when the file is loaded.

0 Kudos
Message 11 of 13
(559 Views)

wiebe@CARYA wrote:

I'd use Spreadsheet String To Array, with a 1D array of strings as input.


Better option:  Just use the Read From Text File.  Right-click on it and there is an option to "Read Lines".  Now set the number to read to -1 to read the entire file.  The output will be an array of strings.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 12 of 13
(554 Views)

@crossrulz wrote:

wiebe@CARYA wrote:

I'd use Spreadsheet String To Array, with a 1D array of strings as input.


Better option:  Just use the Read From Text File.  Right-click on it and there is an option to "Read Lines".  Now set the number to read to -1 to read the entire file.  The output will be an array of strings.


That is a fun feature of Read From Text File that's easy to overlook. You'll lose the option to use "=" as a delimiter for a 2D array output though. Guess you could use Read From Spreadsheet File, but the build in error dialogs are a big no-no for me.

0 Kudos
Message 13 of 13
(542 Views)