Statistical Algorithms Importer: Pre-Installed Project FAQ

From Gcube Wiki
Revision as of 15:13, 20 October 2017 by Giancarlo.panichi (Talk | contribs) (How Use File Input)

Jump to: navigation, search

F.A.Q. of Statistical Algorithms Importer (SAI), here are common mistakes we have found in Pre-Installed Project.


Windows User

Warning, this type of project will be launched in Linux environment. So be careful, all script files need to have a compatible Linux encoding. For example one difference is that Windows uses \r\n, whereas Linux uses \n for line termination. Another example is that Windows support "Unicode" UTF-16LE, and each character is 2 or 4 bytes, whereas Linux uses UTF-8, and each character is between 1 and 4 bytes. Also be aware of the Cut and Paste operation done from Windows machines that can enter unwanted \r\n characters. To solve this problem you can use the "convert to unix" functionality provided by notepad++ for example, or look for this feature in your editor.

How Use File Input

Add input file parameter in Pre-Installed project, this project is DiffBasic:
DiffBasic, SAI
DataMiner show the DiffBasic algorithms in this way:
DiffBasic in DataMiner interface, SAI
Bash script code in sample:
#!/bin/bash
#
# author: Giancarlo Panichi
#
echo "DiffBasic Project";
echo "Author: Giancarlo Panchi";
echo "Parameter operator: " $1;
echo "Parameter options: " $2;
echo "Parameter file1: " $3;
echo "Parameter file2: " $4;
echo "Output file: output.txt";

OUT="output.txt";

case "$1" in
        diff)
            diff $2 $3 $4 > $OUT;
            ;;

        sdiff)
            sdiff $2 $3 $4 > $OUT;
            ;;
        *)
            echo $"Usage: $1 {diff|sdiff}";
            exit 1;
esac
Bash code in sample:

File:DiffBasic.zip