Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I extract the file name that I have opened to a string?

I just need to get the file name of a txt file that has been opened or created by a vi for logging. None of the file functions seems to let me get just the file name.  The only way seems to be to convert path to an array, then array to cluster, and unbundle the cluster to strings but that seems way more complicated than necessary. And since the path can change, the size of the array and number of cluster bundles changes, all I want is the last element or bundle.
 
If I could extract the last item in the path array that would work, but I can't find that function either.
 
This should be so incredibly simple that I can't believe I can't find it.  I feel like the village idiot not being able to do it.
 
Rikard
0 Kudos
Message 1 of 5
(3,620 Views)

File I/O>Strip Path. The 'name' output returns the lasy element of a path as a string.

0 Kudos
Message 2 of 5
(3,613 Views)

Dennis,

Thanks very much for the quick reply. It seems like the simpler the problem the longer it takes me to find the right function.  I'm trying to teach myself LV and it is pretty slow going (the worst instructor I've ever had!)

Thanks,

Rikard

0 Kudos
Message 3 of 5
(3,607 Views)
I can sympathize as that is how I learned many years ago. Now, however, there are a lot more resources available to those who can't take a class. Have you checked the resources at http://www.ni.com/devzone/lvzone/fundamentals.htm?
0 Kudos
Message 4 of 5
(3,602 Views)
Dennis,
 
Thanks very much for the link, the demos look like just what newbies need.
 
Rikard
0 Kudos
Message 5 of 5
(3,585 Views)