LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to add increment number to file name properly

Hi, all:

 

I have a simple question. As shown in the attached code, I need to add an increment number to file name and save the file. The problem is, if you run the code and put something like ".dat" in the extension name, you will see a blank space between the number and the dot in the file name. What should I do to eliminate the blank space? I can't specify the format of the file name since the file name would vary from case to case.

 

Thanks a lot for any suggestion and correction in advance.

0 Kudos
Message 1 of 4
(6,024 Views)

Hi,

 

Please take a look to the attached VI. I hope that I understood what you really want.

I've replaced the Vi: Format into string with Number to Decimal String plus a Concatenate String

Now, this is working for me, I don't get a space anymore.  If something is wrong, please let me know.

 

Regards,

Paul

Message 2 of 4
(6,022 Views)

You don't need to go quite as complicated as Kpanda's example.  What you have is almost OK.

 

The problem is that you don't have the format string constant wired in.  If you right click and select Edit Format String, you'll see it is %d %s by default.  There is a space in between the integer and the string.  Delete that space.  It will create a %d%s format string constant and all will work fine.

Message 3 of 4
(6,000 Views)
Thank you all! My problem is solved. Thanks again.
0 Kudos
Message 4 of 4
(5,975 Views)