LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

obtaining default DIRECTORY

seems trivial but am having a hard time with it.
I need to strip out a default DIRECTORY (not default drive)
from a file name (which includes path).
There is no way for me to know apriori what the
path directory or file name will be, or how many
levels below the drive the file name will reside.

For example: the name might be d:\xxx\yyy\zzz.spc
or it might be d:\zzz.spc.
In the first case, I need to be able to strip out to get
d:\xxx\yyy\ and in the second case, I need to strip
out to be able to get d:\


It is not obvious to me what pattern to search for since
I don't have any clue as to what the file name or path
will be beforehand. Have any ideas?
0 Kudos
Message 1 of 3
(2,878 Views)
donroth455 wrote:

> For example: the name might be d:\xxx\yyy\zzz.spc
> or it might be d:\zzz.spc.
>

Use the function "Strip path". This returns the full path minus the
last item. It does not care how many levels it takes. But of course
you have to send it the full path to begin with.

At least I think this is what you are asking.
Kevin Kent
0 Kudos
Message 2 of 3
(2,878 Views)
Under the Functions Palette/File I/O, use the strip path function. It
returns the stripped path and the last component.

donroth455 wrote:
>
> seems trivial but am having a hard time with it.
> I need to strip out a default DIRECTORY (not default drive)
> from a file name (which includes path).
> There is no way for me to know apriori what the
> path directory or file name will be, or how many
> levels below the drive the file name will reside.
>
> For example: the name might be d:\xxx\yyy\zzz.spc
> or it might be d:\zzz.spc.
> In the first case, I need to be able to strip out to get
> d:\xxx\yyy\ and in the second case, I need to strip
> out to be able to get d:\
>
> It is not obvious to me what pattern to search for since
> I don't have any clue as to
what the file name or path
> will be beforehand. Have any ideas?
0 Kudos
Message 3 of 3
(2,878 Views)