LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String to Filepath

I wonder how i use a number from a for loop in a Filepath.
 
The step I cant do is marked in Bold
 
Input => For Loop[number=>convert to string => insert in string with Format Value or similar => make string to filepath => Write To Spreadsheet File] end of For Loop
 
output should be something like this:
C:\abc\xyz\file1.txt
C:\abc\xyz\file2.txt
C:\abc\xyz\file3.txt
C:\abc\xyz\file4.txt
 
It would be nice if it also had a user interface. 
0 Kudos
Message 1 of 6
(5,321 Views)
Nevermind
I found it. Can't understand how I missed it.
 
"Build Path"
0 Kudos
Message 2 of 6
(5,311 Views)
Hi pitata,

there is also a 'convert string to path' function (LV71: string palette, string/array/path conversion)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 6
(5,309 Views)
Bah.  Just build the path.  In the following example, I use the file dialog express vi to get a base directory.  I also assume you know before hand how many files there will be.  For bonus points, it will pad one zero for 10 or more files, and pad with 2 zeros for 100, etc.




Message Edited by jasonhill on 08-07-2006 09:43 AM

0 Kudos
Message 4 of 6
(5,290 Views)
Thanks allot. I'm back in business.
0 Kudos
Message 5 of 6
(5,275 Views)


@GerdW wrote:
there is also a 'convert string to path' function (LV71: string palette, string/array/path conversion)!


Just as a side comment, I recommend NOT to use "string to path" and "path to string" for any file name manipulation like this.

It is much better and safer to use strip path and build path exclusively for this purpose because they make the program platform independent. If you (even temporarlily) treat entire paths as strings, you run into problems if your program is ever used on a different OS (e.g. Windows vs. Mac vs. Linux).

Message 6 of 6
(5,271 Views)