LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to rename sections in ini-file AND keeping order in the file

Hello,

i have a ini-file that is created in Labview using the "Config File VIs".

 

For example:

[section_1]

key1 = 1

[section_2]

key2 = 1

 [section_3]

key3 = 1

 

Now i am loking for a method to "rename" the sections. I tried with simple "Remove Section.vi" and after this "Write Key.vi" with the new section name.

Works fine BUT now the new section is at the end of the ini-file.

 

How can i rename a section and keep the position inside of the file?

 

Thanks for tips

 

 

0 Kudos
Message 1 of 2
(3,409 Views)

I recommend going the text file route.  Read in the entire file as a string.  Then use Search And Replace Substring to change the name of the section.  Then replace the file.


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
Message 2 of 2
(3,392 Views)