LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the first folder name of path


@edjones93 wrote:

...I have created a VI which will extract all the folder names (include file name) into a string array, ....


 

 How is this different from the Path to array of strings function that has already been mentioned?

 

(Answer: Your code only works on windows, while "path to array of strings" is completely OS independent and thus highly preferred.)

 

0 Kudos
Message 11 of 16
(1,443 Views)

Oh sorry, I didn't see that post, nor have I ever noticed that function node.

0 Kudos
Message 12 of 16
(1,426 Views)

I agree, path to array of strings is not a very well know function. (However, spreadsheet string to array is useful to know.... :D)

0 Kudos
Message 13 of 16
(1,423 Views)

Spreadsheet string to array was an option I considered but you can't control the returned data from what I'm aware, is this correct? While you can control that you input the data as a string.

0 Kudos
Message 14 of 16
(1,406 Views)

@edjones93 wrote:

... but you can't control the returned data from what I'm aware,


Define "control"?

 

You define the output as a 1D array of strings by wiring the "array type" input, you define the field delimiter ("\" in this case) and you define the format of the data between the delimiters (%s in this case). What else do you want to control? Currently, it returns exactly the same as your own code. 😄

0 Kudos
Message 15 of 16
(1,400 Views)

Too true, just tried it and you're right... Still, would be nice to know whether the original question has been answered. You can navigate the hierarchy of files with all the methodologies discussed and even further work through file structures using List Folders in the File I/O palette.

0 Kudos
Message 16 of 16
(1,393 Views)