From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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,281 Views)

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

0 Kudos
Message 12 of 16
(1,264 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,261 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,244 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,238 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,231 Views)