File name in different directory

i have a problem when saving files:
I copied all the files from one directory to another ---with the same file name and I tried to make chnages in the new directory, But I found that all the changes I made in the new directory also happened in the old directory. So Labview recogonize file names only, not file paths. I don't like this feature!!!!!

This is an old problem with no easy solution as of now. For a better description of what is going on here, you can read this discussion where I answered a similar question a while ago.
Ed
Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

Similar Messages

  • Error while reading file name in a directory

    Hi,
    I am trying to read all the file names within a directory, however  I get the below error while running the code.
    Run-time error '5':
    Invalid procedure call or argument
    The actual path is "Q:\Budget\Historical Budgets\FY15\*.xls*"
    and ThisWorkbook.Sheets(1).Range("A1").Value = FY15 in my excel sheet.
    "Below is the code I am using"
    Dim file As Variant
    file = Dir("Q:\Budget\Historical Budgets\" & ThisWorkbook.Sheets(1).Range("A1").Value & "\*.xls*")
    If file = "" Then
            MsgBox "no files"
            Exit Sub
          Else
            ' ... else, count the files
            x = 0
            Do While file <> ""
                x = x + 1
                file = Dir         
    <----  I get the error at this line.
            Loop
    End If
    Could you please help me to solve this problem
    Regards, Hitesh

    Do you want to generate a list of all files in a folder, in your spreadsheet?  If so, please try this sample code?
    Option Explicit
    Private cnt As Long
    Private arfiles
    Private level As Long
    Sub Folders()
    Dim i As Long
    Dim sFolder As String
    Dim iStart As Long
    Dim iEnd As Long
    Dim fOutline As Boolean
    arfiles = Array()
    cnt = -1
    level = 1
    sFolder = "C:\Users\Excel\Desktop\Coding\Microsoft Excel\Work Samples\"
    ReDim arfiles(2, 0)
    If sFolder <> "" Then
    SelectFiles sFolder
    Application.DisplayAlerts = False
    On Error Resume Next
    Worksheets("Files").Delete
    On Error GoTo 0
    Application.DisplayAlerts = True
    Worksheets.Add.Name = "Files"
    With ActiveSheet
    For i = LBound(arfiles, 2) To UBound(arfiles, 2)
    If arfiles(0, i) = "" Then
    If fOutline Then
    Rows(iStart + 1 & ":" & iEnd).Rows.Group
    End If
    With .Cells(i + 1, arfiles(2, i))
    .Value = arfiles(1, i)
    .Font.Bold = True
    End With
    iStart = i + 1
    iEnd = iStart
    fOutline = False
    Else
    .Hyperlinks.Add Anchor:=.Cells(i + 1, arfiles(2, i)), _
    Address:=arfiles(0, i), _
    TextToDisplay:=arfiles(1, i)
    iEnd = iEnd + 1
    fOutline = True
    End If
    Next
    .Columns("A:Z").ColumnWidth = 5
    End With
    End If
    'just in case there is another set to group
    If fOutline Then
    Rows(iStart + 1 & ":" & iEnd).Rows.Group
    End If
    Columns("A:Z").ColumnWidth = 5
    ActiveSheet.Outline.ShowLevels RowLevels:=1
    ActiveWindow.DisplayGridlines = False
    End Sub
    Sub SelectFiles(Optional sPath As String)
    Static FSO As Object
    Dim oSubFolder As Object
    Dim oFolder As Object
    Dim oFile As Object
    Dim oFiles As Object
    Dim arPath
    If FSO Is Nothing Then
    Set FSO = CreateObject("Scripting.FileSystemObject")
    End If
    If sPath = "" Then
    sPath = CurDir
    End If
    arPath = Split(sPath, "\")
    cnt = cnt + 1
    ReDim Preserve arfiles(2, cnt)
    arfiles(0, cnt) = ""
    arfiles(1, cnt) = arPath(level - 1)
    arfiles(2, cnt) = level
    Set oFolder = FSO.GetFolder(sPath)
    Set oFiles = oFolder.Files
    For Each oFile In oFiles
    cnt = cnt + 1
    ReDim Preserve arfiles(2, cnt)
    arfiles(0, cnt) = oFolder.Path & "\" & oFile.Name
    arfiles(1, cnt) = oFile.Name
    arfiles(2, cnt) = level + 1
    Next oFile
    level = level + 1
    For Each oSubFolder In oFolder.Subfolders
    SelectFiles oSubFolder.Path
    Next
    level = level - 1
    End Sub
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Extract JAR file to a different directory

    Is it possible to use the jar command to extract the content of a JAR file to a different directory (not the current directory)?
    I want to use this command inside a makefile, looking for the same effect as "unzip example.jar -d directory".
    Thanks in advanced.

    Thanks Chuck, you solved my doubt... It surprises me that JAR doesn't support this option.
    I used the "unzip" command inside the makefile instead, but I wanted to be sure that there wasn't any chance to use "jar" (without using the additional script file).

  • Can we possible to retrive the file name from the directory...?

    Can we possible to retrive the list of files or file names from the directory...?
    The directory called create or replace directory [directory_name] as ....

    Yeah, yeah its very good example for this scenario.
    I agree. But, I want to learn about Java based PL/SQL code development for that just I am asking any link for this kind of material.....:-)

  • How to create Dynamic Selection List containg file names of a directory?

    Hi,
    I need a Selection List with a Dynamic List of Values containing all file names of a particular directory (can change through the time).
    Basically, I need an Iterator over all file names in a directory, which could be used for Selection List in a JSF form.
    This iterator has nothing to do with a database, but should get the names directly from the file system (java.io.File).
    Can anybody tell me how to create such an iterator/selection list?
    I am working with JDeveloper 10.1.3.2, JSF and Business Services.
    Thank you,
    Igor

    Create a class like this:
    package list;
    import java.io.File;
    public class fileList {
        public fileList() {
        public String[] listFiles(){
        File dir = new File("c:/temp");
        String[] files = dir.list();
        for (int i = 0; i < files.length; i++)  {
                System.out.println(files);
    return files;
    Right click to create a data control from it.
    Then you can drag the return value of the listFiles method to a page and drop as a table for example.
    Also note that the Content Repository data control in 10.1.3.2 has the file system as a possible data source.

  • How to get list of file names from a directory?

    How to get list of file names from a directory?
    Please help

    In addition, this:
    String filename = files;Should be this:
    String filename = files;
    That's just because he didn't use the "code" tags, so [ i ] made everything following it become italicized.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Listing of all file names in a directory

    Hello everyone,
    Is there a way to get the listing of all file names in a directory
    pointed by an entry in dba_directory in oracle into a collection in
    pl/sql procedure.
    Thank you.
    Tuncay

    this is the same problem I am trying to solve now. I found some ehlp in Tom Kyte articles on java stored procedures.
    create global temporary table DIR_LIST
    ( filename varchar2(255) )
    on commit delete rows;
    create and compile java source named "DirList" as
    import java.io.*;
    import java.sql.*;
    public class DirList
    public static void getList(String directory)
    throws SQLException
    File path = new File( directory );
    String[] list = path.list();
    String element;
    for(int i = 0; i < list.length; i++)
    element = list;
    #sql { INSERT INTO DIR_LIST (FILENAME)
    VALUES (:element) };
    create procedure get_dir_list( p_directory in varchar2 )
    as language java
    name 'DirList.getList( java.lang.String )';
    then you call in your pl/sql and fill your collection from the DIR_LIST table:
    get_dir_list('the name of the directory' );
    ---then you fill the collection by fetching the DIR_LIST table
    good luck,
    Florin

  • Load all file names in a directory to a SQL Table

    I need to load all the file names in a directory to a SQL table. It must be done via TSQL or SSIS. If using TSQL cannot use xp_cmdshell or any undocumented sprocs. So I am guessing it will be SSIS. But still open to suggestions. I am an SSIS newbie and need
    a nudge in the right direction of how to get the file names into a SQL table.
    Thanks

    Let me add a bit of background. We are sent a group of files. Each file has the ccyymmdd date attached to the name. Possible that we miss processing one day and the next day there are two sets of files in the directory. file1_20140101, file2_20140101,
    file1_20140102, file2_20140102. I cannot guarantee what the file names will be. Just know that i need to process the 20140101 files in one batch, and then the 20140102 files in the next batch. So thinking that i could read all the file names into a SQL table,
    distinct on the date and then sort by the date and pull off those files to process first. Thinking this will be done in SSIS. Open to any ideas or suggestions.

  • FILE SENDER ADAPTER -  TO GET A DINAMIC FILE NAME IN THE DIRECTORY

    Hi,
         Please help me.
         I have to read by a file sender adapter a specific file in the directory that its name is Dyyyymmdd, where yyyymmdd is variable according with the current day:
         D      - fixed letter
         yymmdd - year,month and day of the current day.
         I cant´t use D* in the File Name Scheme because I must read only the one file generated in the day.
         How can I configure my file sender adapter to read this especific file in the directory?
          Thanks in advance.
          Mider.

    Hi Krishna,
        I must access only one file by time ( of the current day ), but in the directory I have a lot of them of different dates. I mean, in the of the read ( in the adapter configuration ) , I need to configure the name of the file Dyyyymmdd before of the reading in the directory, in other words, I need to construct the name of file (withe the current date) before the communication channel access the file to read it.
        I think that OS command just can be applicated in file receivers, but if possible, at your purpose, how can I access the name of this especific file via OS command for senders?
        Thanks,
             Mider.
    Message was edited by: Midervilson  Andrade
    Message was edited by: Midervilson  Andrade

  • Udf to pass constant corrsponding to 2 file names from different location

    if i have one source file, i m able to pass the file name directly to the target through the udf below:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    return ourSourceFileName;
    But i have 2 files from different location. Now both files has dates at the end. how can i pass AAA for File1.txt and BBB for File2.txt. .
    after the above code, i have included below code too, but not working(*-for date n timestamps):
    if(ourSourceFileName.equals("ABC*.txt"))
    return "FILE1";
    else if(ourSourceFileName.equals("XYZ*.txt"))
    return "FILE2";
    please suggest

    Hi Basker,
    Error in activating object in IR - heres the total code i have used for this purpose. plz help in getting this.
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    return  ourSourceFileName; 
    if(ourSourceFileName.equals("SOURCE_1*.txt"))
    return "File1";
    else if(ourSourceFileName.equals("SOURCE_2*.txt"))
    return "File2";
    Source code has syntax error:  /usr/sap/DXI/DVEBMGS31/j2ee/cluster/server0/./temp/classpath_resolver/Map27461f402eff11e0898d00144f1e71f0/source/com/sap/xi/tf/_MM_UPDATE_.java:839: unreachable statement if(ourSourceFileName.equals("SOURCE1_*.txt")) ^ /usr/sap/DXI/DVEBMGS31/j2ee/cluster/server0/./temp/classpath_resolver/Map27461f402eff11e0898d00144f1e71f0/source/com/sap/xi/tf/_MM_UPDATE_.java:844: missing return statement } ^ 2 errors

  • Unable to  convert the file name in Target directory

    Dear Experts,
    Currently iam facing a problem with some files.my interface is a File to file .As per the interface the sender will pick the flatfiles from source directory which the file name was BNP_NE201.txt once my file reached to target directory the name of the file willrenamed as VENDOR_Payment.NE201 automatically  for this they have done some OS level script in receiver communication channel of the first interface which we have added "un operating system command after message processing" in processing parameters tab.again one more sender comm channel wil pick the file from first target directory which is having naming  convesion of "VENDOR_Payment.NE201 " and post it to target. all the two interfaces are file to file (NFS) . for a parctuclar day files has been posted to 1 st target directory and the receiver communication channel is not yet convert the file names bcz of that the second communication channel can't able to pick the files from target directory. for some times that is working fine and some times it is unable to convert.
    from our side i check every thing .could you please suggest me the way to approch
    Reagrs,
    Kiran tanuku

    >> for a parctuclar day files has been posted to 1 st target directory and the receiver communication channel is not yet convert the file names bcz of that the second communication channel can't able to pick the files from target directory. for some times that is working fine and some times it is unable to convert.
    You need to wait until the file is converted. After when it is converted then the second interface sender communication channel will pick the files.
    What do u mean by unable to convert?
    Is it unable to do the content conversion? if so then check the data as you said that it sometimes it works fine.
    > The best approach is to change the name of the file in the receiver communciation channel instead of using a script.
    Thanks,

  • File Name and Target Directory name issue in FTP CC

    Hi All ,
    I am using following code to assing file name and directory name in UDF. I don;t want these parameters to be part of my target structure. Since i have created these files names in UDF, what are the values do i need to mention in FTP CC's "File access Parameter" which are mandatory fiels in CC ?
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(u201Chttp://sap.com/xi/XI/System/Fileu201D,u201CFileNameu201D);
    String myFileName =biz +".dat";
    conf.put(key, myFileName);
    //Similar code for direcotry
    Thanks for your support.
    MK

    Hi,
    in ID in receiver file comm channel, just tick the option of Adapter Specific messge attributes and in it tick FileName and DirectoryName.............
    the filename and directory you give in comm channel will be treated as dummy and the values will be taken from your UDF.......
    Regards,
    Rajeev Gupta

  • File name with different type

    Hi,
    I need to send specific date format with file name to two different receivers. So the file name is same for both the two receivers but file extension is different. So I configured with dynamic configuration in UDF and in the receiver channel i have given .txt and .dat but it is not working. Can we do it in any other way.
    Thanks,
    kum

    Hi Kum,
    If I am not wrong, you must be using conditional receiver determination for determining 2 receivers.
    In this case, you can define 2 separate mappings which you can call in Interface determinations (2 interface determinations).
    In one mapping, you can have UDF for .txt file and in other .dat file.
    -Tanaya.

  • Method to get all File names in a directory

    Hallo together,
    has Java any method, to get the file names in a specific directory?
    Regards,
    Martin

    ... or simply list() if you're interested in file names only.

  • List all file names in a directory

    Hello everybody,
    I need to write a script in PL/SQL (oracle 10g) that lists all filenames in a specific directory on a client machine and import the files into the database (xml files). After the file is imported they have to be removed.
    I was searching for a solution for this because I have never come accross a challenge like this.
    What I found was that I could use the procedure dbms_backup_restore.searchfiles of the SYS schema.
    Now I need to know how this procedure works. There is very little documentation available.
    Can I give the procedure a folder name on my client computer that has the xml files and let the procedure list these files?
    Can someone please help me with this. I haven't got a clue.
    Thanks in advance.
    regards,
    Mariane

    Hello Justin,
    Thank you for your reply.
    You have just confirmed what I already was thinking: that the server cannot read files from the client.
    I haven't got a client application running to do this. My customer wants me to write a script in PL/SQL that enables users to run an import of xml files in the database by giving in a directory name on the client.
    I told my customer that they have to put the xml files on a server directory. Should that always be the server where the database resides on?
    Is there another way to solve this request?
    Thanks in advance.
    regards,
    Mariane

Maybe you are looking for

  • Windows 7 64-bit

    Hello, I just purchased a MacBook Pro and need some help with Windows 7. I first installed it and it started working perfectly, except for no headphone audio. Now an update has been added to solve this problem, but before I saw that I un-partitioned

  • Backup 3.1 V356 .Mac member name or password is not set

    Hello, I recently changed my .Mac Password and since I have done so, backup fails with .Mac member name or password is not set when I try and backup my personal data to my iDisk. I read on the Backup help to delete all associations with .Mac in the K

  • Top 5 customers and others

    how to implement a chart that shows the top 5 customers in a pie chart and then have a special slice that accumulates all the remaining customers.

  • WBS settled cost in sales order

    Hi, We settlele the WBS to Sales order and where we can see the settled cost in sales order. Kindly suggest. Thanks,

  • GLPCA & VBRP

    Hi, How can i join GLPCA & VBRP. In one of my requirement I need to extract Amounts from VBRP Passing through Financial tables.. Our sales table amount is not matching up with FI tables amounts... Regards Praveen