How can I extract a file name / path from a local path variable in TestStand?

I have local TestStand string variable, call it 'locals.path', that contains a path to a file including the file name (c:\inputs\input.txt). I need to be able to split up the path (c:\input) and the file name (input.txt) and save them into 2 local variables. What is the best way to do this?
After reading through some of the other forums, it looks like there are some built-in functions that can accomplish this, but I am unable to find how to use them anywhere on the NI web site. One forum said to use the File I/O>Strip Path.file function. How is this called? Is this function in a DLL?
I know that there are a number of DLLs that are installed with TestStand into the c:\windows\system32 directory. One forum made note of CVI_OpenFile / CVI_ReadFIle functions in the cvirt.dll that I used to solve a problem that I had in the past. The problem is that I had no idea that that these functions even existed and would have never known unless a similar question had been posted previously. Is there some place that these DLL function interfaces are defined or documented? Is there a function that can extract the file name out of a string for me?
Thanks,
Mike

Hi,
There sound like functions in say LabVIEW or CVI.
I have attached a small example which may help. (I have not allowed for any error trapping, if say you dont find the file and cancel)
Regards
Ray Farmer
Message Edited by Ray Farmer on 10-16-2006 10:04 PM
Regards
Ray Farmer
Attachments:
Sequence File1.seq ‏33 KB

Similar Messages

  • How can I assign image file name from Main() class

    I am trying to create library class which will be accessed and used by different applications (with different image files to be assigned). So, what image file to call should be determined by and in the Main class.
    Here is the Main class
    import org.me.lib.MyJNIWindowClass;
    public class Main {
    public Main() {
    public static void main(String[] args) {
    MyJNIWindowClass mw = new MyJNIWindowClass();
    mw.s = "clock.gif";
    And here is the library class
    package org.me.lib;
    public class MyJNIWindowClass {
    public String s;
    ImageIcon image = new ImageIcon("C:/Documents and Settings/Administrator/Desktop/" + s);
    public MyJNIWindowClass() {
    JLabel jl = new JLabel(image);
    JFrame jf = new JFrame();
    jf.add(jl);
    jf.setVisible(true);
    jf.pack();
    I do understand that when I am making reference from main() method to MyJNIWindowClass() s first initialized to null and that is why clock could not be seen but how can I assign image file name from Main() class for library class without creating reference to Main() from MyJNIWindowClass()? As I said, I want this library class being accessed from different applications (means different Main() classes).
    Thank you.

    Your problem is one of timing. Consider this simple example.
    public class Example {
        public String s;
        private String message = "Hello, " + s;
        public String toString() {
            return message;
        public static void main(String[] args) {
            Example ex = new Example();
            ex.s = "world";
            System.out.println(ex.toString());
    }When this code is executed, the following happens in order:
    1. new Example() is executed, causing an object to constructed. In particular:
    2. field s is given value null (since no value is explicitly assigned.
    3. field message is given value "Hello, null"
    4. Back in method main, field s is now given value "world", but that
    doesn't change message.
    5. Finally, "Hello, null" is output.
    The following fixes the above example:
    public class Example {
        private String message;
        public Example(String name) {
            message = "Hello, " + name;
        public String toString() {
            return message;
        public static void main(String[] args) {
            Example ex = new Example("world");
            System.out.println(ex.toString());
    }

  • How can I edit the file name of the home page?

    How can I edit the file name of the home page?
    Gr Ammani

    I have a similar issue with regards to the filename...
    When I navigate to my website, it doesnt work unless I actually type the filename at the end of it. Example: type in "www.whitelion.com" (this is my real domain name) and it doesnt work. When I type in "www.whitelion.com/index.html" then it works.
    This is obviously inconvenient because my clients will never know to add the filename to the end of the site.
    Is there any setting or way to get the page to appear by just typing the original domain name without adding the extension?
    Thanks,
    Emelia

  • When bates numbering a .pdf in XI, how can I change the file name to include the bates number AND its name?  I know under file output, there is an option for either/or.  I want both.  Thank you.

    when bates numbering a .pdf in XI, how can I change the file name to include the bates number and the file name?  I know under "file output: it's either/or.  I need both.  Thanks!

    Long ago I wrote a little demo using the touch command. Check out the following thread:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=25128#M25128
    LabVIEW Champion . Do more with less code and in less time .

  • How can I process raw files in Aperture from a Sony RX1?

    How can I process raw files in Aperture from my Sony RX1?

    Here is a list of supported cameras
    <http://www.apple.com/aperture/specs/raw.html>
    Your Sony RX1 is not listed. Your best bet would be to use the software, that came with your camera to convert the raw files to tiff and to import the tiff to Aperture. Or to shoot raw+jpeg and to import the pairs and to work with the jpeg versions as original master files, until Aperture supports your camera.
    Regards
    Léonie

  • How can i change upload file name?

    hi
    I performed a upload Jsp page by OJSP file access in jdeveloper,and it can upload file!
    but i want to change uplaod file name!
    How can i do?
    Any help will be appreciated!
    Thanks
    Jiawei Zhao

    My questions are
    1) when use oreilly package to do file upload , it looks like i line of code is enough to store the upload file in the
    file direction.
    MultipartRequest multi =
            new MultipartRequest(request, dirName, 10*1024*1024); // 10MB
    why some example still use FileOutputStream?
    outs = new FileOutputStream(UPLOADDIR+fileName); 
        filePart.writeTo(outs); 
       outs.flush(); 
      outs.close();
    2) can I rename the file name when I use oreilly package?

  • How can I extract a piece of video from a DVD ?

    Dear all,
    I recorded a DVD of a TV broadcast. I'd like to get an extract from it and use it in a presentation later (such as powerpoint).
    How can I extract the piece of video ?
    Is is possible to record it with quicktime (for example) or any other application ?
    thanks for your help
    Didier

    MPEG Streamclip and the Apple MPEG-2 component will allow you to edit the VOB files off the DVD and export to MPEG-4. Searching here will provide this answer several hundred times as it is asked a LOT. More so for iPod users. You cannot export or edit and then export MPEG1/2 with Quicktime unless you do not need the audio as there won't be any.

  • How can i extract using while the time from the string ?

    First time how can i extract the time as string ?
    And second how can i extract the time as DateTime.Now ?
    public static void ExtractDateTime()
    htmltoextract = new Uri("http://test.com");
    client = new WebClient();
    f = client.DownloadString(htmltoextract);
    client.Dispose();
    int index = 0;
    while (index != -1)
    int t = f.IndexOf(firstTag);
    int g = f.IndexOf(lastTag);
    a = f.Substring(t + firstTag.Length, g - t - 8);
    The string look like this: thisisateststring201309202145andthenextimeinthestringis201309202130andthelastofthisexampletimeinthisstringis201309202115
    What i need to do is first time to extract the time as string to a List<string> like this:
    index 0 201309202145
    index 1 201309202130
    index 2 201309202115
    The second time to extract the times as this time format: YYYYMMDDhhmm and also to add the times to a List.
    First time and second time i mean first example and second example. To use my code but first time to extract it as strings second example as the format of YYYYMMDDhhmm
    And i need to use the while and indexof and substring in this cases.

    Is the region always going to be "eu" or are you going to have more than one region.  Since you are reading a string DateTime from different timezone than the computer you are reading the data you have to convert to a different timezone. 
    It looks like you have at least 'is' and 'eu' for regions.  I don't know what offsets you need so try something like this.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Globalization;
    using System.IO;
    namespace ConsoleApplication1
    class Program
    static void Main(string[] args)
    string input = File.ReadAllText(@"c:\temp\test.txt");
    string pattern1 = @"imageUrls = \[[^\]]*\]";
    Regex ex1 = new Regex(pattern1, RegexOptions.Singleline);
    string pattern2 = @"region=(?'region'[^&]*)&time=(?'time'\d{12})";
    Match match1 = ex1.Match(input);
    Regex ex2 = new Regex(pattern2, RegexOptions.Singleline);
    MatchCollection matches2 = ex2.Matches(match1.Value);
    IFormatProvider provider = CultureInfo.InvariantCulture;
    List<DateTime> dateTime = new List<DateTime>();
    foreach (Match match2 in matches2)
    string region = match2.Groups["region"].Value;
    DateTime dt = DateTime.ParseExact(match2.Groups["time"].Value, "yyyyMMddHHmm", provider);
    switch (region)
    case "eu" :
    dt.AddHours(1);
    break;
    case "is":
    dt.AddHours(-1);
    break;
    dateTime.Add(dt);

  • How can i transfer music files on iPod from iPhone 4?

    Hi,
    how can i transfer music files from iPod from iPhone using Bluetooth.
    Thanks in advance,
    Suresh Balakrishnan

    you can't
    synch both with a computer is the only way

  • Hi! I've bought a new ipad air. How can i transfer music files via itunes from PC?

    Hi! i've bought a new ipad air. How can i transfer music files from my normal PC to ipad. I've already installed itunes in my PC also. Please help in this regard.
    Thank you

    SYNCING with iTunes
    See here  >  http://support.apple.com/kb/HT1386
    More Info >  http://www.apple.com/support/ipad/essentials/

  • (How) can I change multiple file names in a folder?

    My new scanner creates file names with with long, repeated numerical sequences.  Can I edit (shorten) the names in batches?

    Hey man, no problem.
    There are several sites you can look at that will give you a good idea on how to use Automator, such as:
    Mac 101: Automator
    Automatedworkflows.com tips and videos
    (This is the site where I learned everything really, and this site also provides 3rd party actions that have greately helped me with better workflows)
    Automator.us videos
    Good luck man.

  • How can I Bulk add file name to picture

    I want to add the file name to the picture, so that when people look at the picture the file name is embedded into the picture.
    I have done some research on this top and have found some mention of tools that people have build to do this and indeed many different things I suppose.
    Im using PSE 10. Windows 7 Prof.  From what I understand, I cant build tools because my version eg Elements is not full blown. But if people have build something to do this I can then add it to my software and it will function for me.
    While in full, quick or even guided there appears to be an option under File/Automation Tools. This appears to be what I need.
    Can anyone tell me where this add on is and how to use it, I cant seem to find it and I really dont know if it will work with PSE 10. Many of the refrences I have seen seem to be for earlier version.
    Perhaps there is an easier way ??
    Thanks

    Good question.
    Basically what I want is the name of the photo name actually in the photo.  I have 400 pictues, I want to put them into a digital picture frame, and I want each picture to be display with the name of the pictures eg. Florida 2012.jpg and Grand Canyon.jpg. Of course I dont need the .jpg extention. But If it is there I can live with it. Im not sure if the Caption option in photoshop elements  can be exported so that the caption is hard wired into the picture. maybe it is. HOWEVER, what I dont want to do is go through 400 pictures and type in the caption for each pictures, if this option is available. It would be nice if the utility copyed the fild name into the caption, if you  could save it with the caption name, but I think Im asking too much.
    Anyway basically I want the file name build into the  photo how ever this could be done in a bulk mode.
    Is that  a lttle clearer. Here is an examle worth a 1000 words.
    BTW I did an experiment and if you put the name in the caption line of the photo. It does not get exported with the file name in the picture. ( which I would asume since not many want the name in the photo, ) Although maybe there is some option that can be turned on to do this ??
    Regards

  • How can I check original file name

    Hi all
    How can I check the original file name of a slide while in Keynote.
    Mike Hooley

    Hi Sara,
    Thankyou for your reply. What I meant was , how do you tell the original format , for example microsoft word, excel , powerpoint , jpeg, tiff , that the file was before it was converted to a PDF.
    So for example, i get a pdf file from someone and i want to know was it an exel file or a word file of  a Jpeg or scanned doc before they converted it to a pdf.
    It appears to me this information is not availabel in the file properties unless i am missing something.
    Regards
    Steven

  • How can we change the file name character limit on PSE 7?

    When I save for web I need more than 26 characters in the file name. Can you please tell me how to turn this Mac compatibility option off? Thanks.

    Save the file with a short name and rename afterward.
    Juergen

  • How can transfer the read file name via own developed adapter module

    Hello experts,
    I want to know how I can handle the following issue:
    I developed a J2EE adapter module for the file adapter "sender" with the aim to read the file name of incoming files. Thereto I implement the following code like this:
    public ModuleData process(ModuleContext mc, ModuleData md) throws
    ModuleException
    Hashtable mp = (Hashtable)
    md.getSupplementalData("module.parameters");
    String fileName = null;
    if (mp != null)
    fileName = (String) mp.get("FileName");
    Now I get the filename which includes a order nr.  I need this order number to call a RFC Adapter via mapping. So my question is how can transfer this order nr to the RFC adapter?
    Kind regards,
    Fatih

    Hi,
    >> to read the file name of incoming files
    Use file adapter with Adapter specific identifiers selected.
    >>Thereto I implement the following code like this:
    use udf in message mapping and avoid module
    >>Now I get the filename which includes a order nr. I need this order number to call a RFC Adapter via mapping. So my question is how can transfer this order nr to the RFC adapter?
    use RFC Look up function in message mapping...
    Is module so necessary in this case???
    Regards
    Suraj

Maybe you are looking for

  • Acrobat 8.1.3 requires two double clicks to open a file

    Our agency has a VB app that uses adobe to pull up files routinely (for many employees I support they use this app to pull up dozens of documents a day). Use to be that when you want to pull up a PDF file from the VB app you double clicked once and t

  • Limit PO - Confirmation with Time and Material

    To All: We are in SRM 7.0 - Classic Scenario and ECC 6.0 EHP4. We implemented the use of Limit PO in SRM to enable us to create a PO for Services that will give us the Value Limit and Expected Value functionality. In our scope the Limit PO can be con

  • 'Could not Sign In' Apple ID couldn't be created because of a server error.

    I recently attempted to restore my iPod and cannot get any further than the security question and terms to agree to.  My email address is [email protected]   Please help!

  • SUS - Hide / Disable column table

    Hi Experts, I need to hide or disable two columns within the edit order screen in SUS. When you display a purchase order in SUS and then click on process button two buttons are displayed in the item details table for accept or reject PO positions. I

  • Example for a client independent table

    I need some names of tables which are client independent.