Jump to content

Read all INI files in directory


Recommended Posts

Hi,

 

I am currently using OpenG to read an INI file into a big cluster (with subclusters), split that one up and save the subclusters into shared variables. Not this is ok, although it is very static.

Now what I am trying to achieve is splitting the sections of my INI files into separate files. For simplicity the file name should be the section name and so on. The problem is that clusters are extremely static and I can't get anything to work.

The perfect thing would be something like the attached. Pass a directory and a cluster to a subvi, get the cluster with values from INI back. The file name would be constructed from the cluster name.

Is this possible at all?

Link to comment
Check out "List Folder.vi" in the Advance File Function palette. This will get you all folders/files in a directory. So once you built the directory path you could loop through all the INIs.

Well, reading all files in a folder is easy, the problem are the clusters! How can I pass the correct cluster to OpenGs read ini vi? I tried a lot and in the end I always fail because clusters are so extremely static.

Link to comment
Well, reading all files in a folder is easy, the problem are the clusters! How can I pass the correct cluster to OpenGs read ini vi? I tried a lot and in the end I always fail because clusters are so extremely static.

Clusters being static is by design.  If you data type is flexible at run time then you don't want a cluster you want a variant (which may or may not be a cluster).  But at some point you need to know what you are dealing with.

Link to comment
Use the OpenG variant config to save the clusters to a normal ini-file then run this on it (you might want a little more error checking).

Split-Ini.vi

Well, this did not really solve my problem, but it gave me the idea to use it the other way around. This is really really ugly, but I am creating a single ini from all other inis in the directory and use that one to read it into my config cluster.

Thanks...

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.