WIN

  • 06 Jan

    Moving data from lab computers

    A while ago we received a request from a customer to move data from lab computers. Some of those lab computers were XP and could not be upgraded. The idea was to work with scripts on the lab computers which would trigger the moving of data.

    Develop a script that would be installed on each of the instrument computers. The script will be used to move the data from the lab computers to a server. Once the measurement is completed, the script will be activated by the user and the file transfer should start.

    We proposed the following to the customer:

    1. Create a simple command (cmd) file on each lab computer that when activated would create a ‘dummy’ file in a shared folder (i.e. transfer.txt )

    Limagito File Mover moving data from lab computers
    2. Put this command file on the desktop (or a shortcut) of the lab computer
    3. Run this command also when the user logs off ( https://www.tek-tips.com/viewthread.cfm?qid=606106 )
    4. The File Mover, installed on a central server, would check if this ‘dummy’ file exists and in case it does, will move the files to the server (and also delete the dummy file).
    The advantage is that you can use a recent version of our File Mover and also the effort you need to spend on XP is very little.
    They agreed and we installed our Limagito File Mover on their Windows 2019 server.  We are scanning all their lab computers for this ‘transfer.txt’ file. It it exists, then we move the data from the lab computer to a storage server. A very important part was logging and that is why we enabled full debug mode history logging. The dummy ‘transfer.txt’ file is deleted after a successful move of all data,

    Update 15/01/2022

    The customer created a command file (transfer.cmd) with the following content. This command file is installed on all their lab computers and will create a dummy transfer.txt file in the C:\Data folder.

    ********************************
    @ECHO OFF
    C:
    CD\
    CLS
     
    :MENU
    CLS
     
    ECHO ============= Choose to move Data to server! =============
    ECHO ============= Your Experment muts be complete! =============
    ECHO ============= If not complete press 2 now! =============
    ECHO -------------------------------------
    ECHO 1.  Move of Lab Data to Server
    ECHO 2.  Do nothing and exit
    ECHO -------------------------------------
    ECHO ==========PRESS 'Q' TO QUIT==========
    ECHO.
     
    SET INPUT=
    SET /P INPUT=Please select a number:
     
    IF /I '%INPUT%'=='1' GOTO Selection1
    IF /I '%INPUT%'=='2' GOTO Quit
    IF /I '%INPUT%'=='Q' GOTO Quit
     
    CLS
     
    ECHO ============INVALID INPUT============
    ECHO -------------------------------------
    ECHO Please select a number from the Main
    echo Menu [1-2] or select 'Q' to quit.
    ECHO -------------------------------------
    ECHO ======PRESS ANY KEY TO CONTINUE======
     
    PAUSE > NUL
    GOTO MENU
     
    :Selection1
     
    @echo **The Lab Data is scheduled to move to the server**
    :input
    echo > "c:\xladata\transfer.txt"
    ECHO ==============THANKYOU===============
    ECHO -------------------------------------
    ECHO ======PRESS ANY KEY TO CONTINUE======
     
    PAUSE>NUL
    EXIT
     
     
    @ set INPUT=
    @ set  /P INPUT=Type input: %=%
    if "%INPUT%"=="" goto input
    :exit
    CLS
     
    ECHO ==============THANKYOU===============
    ECHO -------------------------------------
    ECHO ======PRESS ANY KEY TO CONTINUE======
     
    PAUSE>NUL
    EXIT
     
    :Selection2
     
    :Quit
    CLS
     
    ECHO ==============THANKYOU===============
    ECHO -------------------------------------
    ECHO ======PRESS ANY KEY TO CONTINUE======
     
    PAUSE>NUL
    EXIT

     

    If you need any info about this ‘Moving data from lab computers’, please let us know.

    #FileTransfer

    Best regards,

    Limagito Team

    By Limagito WIN ,
  • 24 Nov

    Q&A 47: Question regarding multiple source

    Q: Question regarding multiple source. I have to delete files from multiple paths. My filter rule (folder/files) is exactly the same this is why I would like to create one Limagito rule for more than one source. In the Source window, I can weite only one source…

    Limagito File Mover Multiple WIN as Source

    Is it possible to create one limagito rule for several source ?

    A: Yes (only) with WIN as Source separate them with ;

    For example:

    Limagito File Mover Multiple WIN as Source

    #FileTransfer

    If you need any info about this question, please let us know.

    Best regards,

    Limagito Team

    By Limagito WIN ,
  • 14 Nov

    I want to be able to Find in File text content. Is this possible ?

    Q: I want to be able to Find in File text content. Is this possible? For example, if the file contain a string in the file content, than do an operation. Is it possible in Limagito or we can only do something with the file name?

    In attachment, you will find folders and files example.

    –          If we find the string ST^832^ then we need to move the file in the folder « Price »

    –          If we find the string ST^810^ then we need to move the file in the folder « Invoice »

    So, the process should do this :

    –          Move the files !EDIFile.Exaple1 and !EDIFile.Example2 in folder « Price »

    –          Move the file ASSET.Example in folder « Invoice »

    A: Yes this is possible using a custom script which we create for you. I’ve added some screenshots to help you.

    • Source is a Windows folder:

    Limagito File Mover Windows Folder as Source

    • Open ‘Pascal Script’ Setup:

    Limagito File Mover Pascal Script option

    • Enable and add the following ‘On Destination’ Pascal Script:
    Var
      tmpFile: String;
      tmpList: TStringList;
    Const
      ctInvoiceSearch = 'ST^810^';
      ctPriceSearch = 'ST^832^';
      ctInvoiceSubDir = 'Invoice';
      ctPriceSubDir = 'Price';
    Begin
      psVSA := '';
      psExitCode:= 0;
      // ... add your code here
      tmpFile := psFilePath + psFileName;
      tmpList := TStringList.Create;
      Try
        Try
          tmpList.LoadFromFile(tmpFile);
          // Check Invoice
          If pos(ctInvoiceSearch, tmpList.Text) <> 0 Then
          Begin
            psVSA := ctInvoiceSubDir;
            psExitCode := 1;
            psLogWrite(1, '', 'Destination SubDir: ' + ctInvoiceSubDir + ' for ' +tmpFile);
          End;
          // Check Price
          If pos(ctPriceSearch, tmpList.Text) <> 0 Then
          Begin
            psVSA := ctPriceSubDir;
            psExitCode := 1;
            psLogWrite(1, '', 'Destination SubDir: ' + ctPriceSubDir + ' for ' + tmpFile);
          End;
          // Nothing was Found
          If psVSA = '' Then
          Begin
            psLogWrite(1, '', 'Destination SubDir Unknown for ' + tmpFile);
          End;
        Except
          psLogWrite(1, '', 'Error loading ' + tmpFile);
        End;
      Finally
        tmpList.Free;
      End;
    End.

    Limagito File Mover On Destination Pascal Script

    • Set Function to ‘Move Files’:

    Limagito File Mover Function Setup

    • Add ‘WIN’ as Destination

    Limagito File Mover Destination Selection

    • Select your Destination Directory:

    Limagito File Mover WIN as Destination Setup

    • Adjust the default ‘Create Subdir, option’ to:  %VSA\%SFS

    The reason you need to change this is because we’ want to use information from the previous Pascal Script to select the correct Subdirectory. In this example it will be ‘Price’ or ‘Invoice’.

    Limagito File Mover Destination Sub Directory Setup

    • RunTime Log Result:

    Limagito File Mover RunTime Log

    #FileTransfer

    If you need any info about this ‘Find in File text content’ question, please let us know.

    Best regards,

    Limagito Team

1 2 3 4 5