Automating NimbleSET from the Command-Line

Once you buy a license for NimbleSET, you unlock the awesome power of the command-line.

Everything you do in NimbleSET can also be done from the command-line.

First I'll give you the quick guide, then show you the built in command-line helper for NimbleSET which makes this all too easy. And finish off with the complete command-line reference which describes every possible commandline argument (aka parameter) and option (aka flag) as well as their abbreviations.

 

  1. Quick Guide
  2. The Built in Command-line Helper
  3. The Complete Command-line Reference

 

Quick Guide

The most common use case for the command-line is that you want to send in a left and right file, specify an operation, and write the output to a file. Here's how you do that:

Assuming we have files called 'left.txt' and 'right.txt' and we want their intersection:

NimbleSET.exe -l "left.txt" -r "right.txt" --intersect
-o "output.txt"

Here we've specified a left file (using the abbreviation '-l'), a right file (using the abbreviation '-r'), the intersect operation, which selects only those rows which are in both the left and the right files, and an output file (-o).

Specify your output

There are three different ways you can receive the output. If you use the 'gui' flag, then the user interface will be shown, and you can access the result there. You can specify an output file, and the result will be written there, using the 'outputfile' argument.

If you don't specify the outputfile argument, or the gui flag, then the output is written to standard out.

If you don't specify an output file, then it is written to the console.

 

Redirecting output to a file: No.

Even though NimbleSET and the command-line are good friends, NimbleSET is not a console application, it is a Windows application. (If it was a console app, you'd see a command prompt everytime you run the exe).

And because NimbleSET is not a console application, you cannot using a redirect operator (>) to direct the output directly into a file. To send its output to a file, you need to use the --outputfile (-o) argument, and specify a filename.

See also:

 

The Command-Line Helper

Under the tools menu you'll find the Command-Line Helper. This is a handy built-in tool to make command-line automation dead simple.

Command-Line Helper, a handy built in tool to make command-line automation dead simple.

Just pick the options you want and, as you do, a sample of the required command-line is provided at the foot of the form.

Once you're happy with it you can save it as a batch file, or copy it to the clipboard.

You can also press 'execute' to try it out immediately. (A command prompt will open up, and run the command-line you've built up.)

All tools that run from the command-line should provide a helper like this!

 

Complete command-line reference

The following examples assume we have two files, left.txt and right.txt, with content as follows:

Left.txt

A
B
C
e
G

Right.txt

A
B
C
D
E
F

'left' Argument (-l)

Argument Name: left

Abbreviation: l

Purpose: Specify file that will be treated as the 'left' file

Example:

NimbleSET.exe --left="left.txt" -right="right.txt" --intersect --output="output.txt"

Result:

Output.txt now contains:

A
B
C
e       

 

'right' Argument (-r)

Argument Name: right

Abbreviation: r

Purpose: Specify file that will be treated as the 'right' file

Example:

NimbleSET.exe --left="left.txt" -right="right.txt" --rightonly --output="output.txt"

Result:

Output.txt now contains:

D
F

 

'output' Argument (-o)

Argument Name: output

Abbreviation: o

Purpose: Specify file name of outputfile

Example:

NimbleSET.exe --left="left.txt" -right="right.txt" --intersect --output="output.txt"

Result:

Output.txt now contains:

A
B
C
e       

 

'leftonly' Argument (-lo)

Argument Name: leftonly

Abbreviation: lo

Purpose: Specify put rows that are only in the 'left' file (and not in the right) into the result

Example:

NimbleSET.exe --left="left.txt" -right="right.txt" --leftonly --output="output.txt"

Result:

Output.txt now contains:

g

 

'intersect' Argument (-b)

Argument Name: intersect

Abbreviation: b

Purpose: Specify put rows that are in both left and right files into the result

Example:

NimbleSET.exe --left="left.txt" -right="right.txt" --intersect --output="output.txt"

Result:


    

 

'rightonly' Argument (-ro)

Argument Name: rightonly

Abbreviation: ro

Purpose: Specify put rows that are only in the 'right' file (and not in the left) into the result

Example:

NimbleSET.exe --left="left.txt" -right="right.txt" --rightonly --output="output.txt"

Result:


    

 

'union' Argument (-u)

Argument Name: union

Abbreviation: u

Purpose: Specify put each row from left and right file into the result

TIP: This is best used with a 'distinct' operation.

Example:

NimbleSET.exe --left="left.txt" -right="right.txt" --union --distinct --output="output.txt"

Result:


    

 

'distinct' Argument (-d)

Argument Name: distinct

Abbreviation: d

Purpose: Specify if a line is repeated, only show it once

Example:

NimbleSET.exe --left="left.txt" -right="right.txt" --union --distinct --output="output.txt"

Result:


    

 

'sort' Argument (-s)

Argument Name: sort

Abbreviation: s

Purpose: Specify sort the result (alphabetic, case-insensitive, ascending)

Example:

NimbleSET.exe --left="left.txt" -right="right.txt" --leftonly --sort --output="output.txt"

Result:


    

 

'invert' Argument (-i)

Argument Name: invert

Abbreviation: i

Purpose: Specify invert the order of the results (this is applied after sorting)

Example:

NimbleSET.exe --left="left.txt" -right="right.txt" --rightonly --sort --invert --output="output.txt"

Result:


    

 

'casesensitive' Argument (-c)

Argument Name: casesensitive

Abbreviation: c

Purpose: Options to perform all comparisons in a case-sensitive manner, e.g. 'A' does not equal 'a'.

Example:

NimbleSET.exe --left="left.txt" -right="right.txt" --intersect --casesensitive --output="output.txt"

Result:


    

 

'gui' Argument (-g)

Argument Name: gui

Abbreviation: g

Purpose: Show the Graphical User Interface

Example:

NimbleSET.exe --left="left.txt" -right="right.txt" --gui

Result:


    

 

'verbose' Argument (-v)

Argument Name: verbose

Abbreviation: v

Purpose: Specify Display verbose messages

Example:

NimbleSET.exe --left="left.txt" -right="right.txt" --leftonly --verbose --output="output.txt"

Result:


    

 

'help' Argument (-?, -h)

Argument Name: help

Abbreviation: ? or h

Purpose: Show a message much like the following, and exit.

Example:

NimbleSET.exe -?

Result:

Manipulate text with nimble patterns.

Usage: NimbleSET.exe [options]
If no options are specified, a gui is presented.

Options:
  -l, --left=VALUE           file that will be treated as the 'left' file
  -r, --right=VALUE          file that will be treated as the 'right' file
  -o, --output=VALUE         file name of outputfile
      --lo, --leftonly       put rows that are only in the 'left' file (and not
                               in the right) into the result
  -b, --intersect            put rows that are in both left and right files
                               into the result
      --ro, --rightonly      put rows that are only in the 'right' file (and
                               not in the left) into the result
  -u, --union                put each row from left and right file into the
                               result
  -d, --distinct             if a line is repeated, only show it once
  -s, --sort                 sort the result (alphabetic, case-insensitive,
                               ascending)
  -i, --invert               invert the order of the results (this is applied
                               after sorting)
  -c, --casesensitive        perform all comparisons in a case-sensitive manner
  -g, --gui                  show the Graphical User Interface
  -v, --verbose              Display verbose messages
  -?, -h, --help             show this message and exit