LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a blank line in configuration file

Hi,

 

I would like to add an empty / blank line in my configuration file. (.ini file) as below:

 

[H1]

key1=1

 

[H2]

key2=2

 

I don't have any idea on how to add the empty/blank line.

Could anyone help me on this? 

Message 1 of 9
(4,540 Views)

You could use a text editor (like notepad).

 

Now, if you are going to write to it with LabVIEW, I would suggest a comment line instead of a blank line.  Comments are after ;  (but don't use it on the same line as text or it will think it's part of the text. 

 

In other words:

 

[H1]

key1=1

;

[H2]

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




Message 2 of 9
(4,539 Views)

Thanks for the advise.

 

However, when I put comment, I  got symbol ;=""

 

[H1]

Key1=1

;=""

[H1]

Key2=2

 

Can I delete this symbol (;=""), so that I can get the empty/blank line?

 

 

Message 3 of 9
(4,529 Views)

Forgot about that.  Same thing happens to me.  I just never bothered trying to figure out a way to get rid of it.

 

I suppose if you were really ambitious, you could close the file, read each line back and eliminate all of the lines that start with ;=

 

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




Message 4 of 9
(4,527 Views)

Sometime ago I was complaining about the very same thing.  http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=273519#M273519

 

I made a modification to the NI library to add the blank line.  Several people pointed out to me that modifying the library file was a bad idea.  I'm sure my modifications I made are now lost as I have upgraded LV a few times since then.

 

But perhaps if you made those modifications and save the entire library under a new name, store it in a safe place for user files, you could use the the modified library to write blank lines between sections.

 

I put in a product suggestion, but I don't know if anything will come of it.  I would recommend that you put in a product suggestion as well.

Message 5 of 9
(4,516 Views)

 

I would like to add an empty/blank line for more than two line. Therefore, I try to write the comment (;) a few time in the same group.

However, I unable to do it. 

 

Below is what I'm trying to get: 

[H1]

K1=1

;

;

[H2]

K=2

 

0 Kudos
Message 6 of 9
(4,493 Views)

Hello All,

I made a test-VI, which does what you want. But as you can see, when you open/close the Config file with theConfig File VIs (run "Step 2" in Test-VI), the blank lines are always removed. You have to consider this.

Greets, dave

Greets, Dave
0 Kudos
Message 7 of 9
(4,461 Views)

I just noticed something that I believe was added in LV 2009, but I could not find a mention of it in the What's New and changed section of the help file

 

It appears that the configuration files now add blank lines between the sections.

 

There were some comments about other improvements to the Config File I/O VI's such as only writing out the configuration file if it has actually changed.

 

Thanks for improving this in LV 2009.  It greatly improves the readability of the the config files that are created.

0 Kudos
Message 8 of 9
(4,215 Views)
In case you do not have such luxury, like me... 
This example VI show an alternative way of inserting empty line/ space between sections of a configuration file...

PS1: Note that Additional Empty Element is intentionally added to create/ add empty line/ space between sections... 

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 9 of 9
(4,208 Views)