ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get directory from file path

Solved!
Go to solution

How do I get the derectory from a filepath?

Eg.: c:\Users\mko\Documents\test\data.txt

should give me the directory 

c:\Users\mko\Documents\test\

0 Kudos
Message 1 of 8
(9,591 Views)

How do I get the derectory from a filepath?

Eg.: c:\Users\mko\Documents\test\data.txt

should give me the directory 

c:\Users\mko\Documents\test\

0 Kudos
Message 2 of 8
(9,585 Views)
Solution
Accepted by Michael.Koppelgaard

Did you try Strip Path primitive?

For your case use 2 strip path primitives one after the other

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 8
(9,579 Views)
Solution
Accepted by Michael.Koppelgaard

Hi P@Anand,

 

using StripPath just once should be enough to strip the filename from the path…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(9,577 Views)
Solution
Accepted by Michael.Koppelgaard

When I replied I guess I saw the expected path was "c:\Users\mko\Documents".

 

Yeah you are right using one strip path is sufficient

-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 8
(9,574 Views)
0 Kudos
Message 6 of 8
(9,576 Views)

Duplicate Post

-----

The best solution is the one you find it by yourself
0 Kudos
Message 7 of 8
(9,568 Views)

Just what I wanted 🙂

0 Kudos
Message 8 of 8
(9,557 Views)