Learn how to use the scripting console to deduplicate items in a case.
2 minute read
Example Scripts
The following scripts show simple examples of how to deduplicate items using the script console in Nuix Workstation.
1
2
3
4
5
items=$current_case.searchUnsorted('')start=Process.clock_gettime(Process::CLOCK_MONOTONIC,:millisecond)dedupedItems=$utilities.getItemUtility().deduplicate(items);elapsed=Process.clock_gettime(Process::CLOCK_MONOTONIC,:millisecond)-startputs"Deduplicated #{dedupedItems.count} items in #{elapsed} ms."
1
2
3
4
5
6
items=$current_case.searchUnsorted('');start=Date.now();dedupedItems=$utilities.getItemUtility().deduplicate(items);end=Date.now();elapsed=parseInt(end-start)print("Deduplicated "+dedupedItems.length+" items in "+elapsed+" ms.")
1
2
3
4
5
6
7
8
importtimeitems=current_case.searchUnsorted('');start=int(time.time()*1000)dedupedItems=utilities.getItemUtility().deduplicate(items);end=int(time.time()*1000)elapsed=(end-start)*1000print('Deduplicated '+str(len(dedupedItems))+' items in '+str(elapsed)+' ms.')
Console Output
Command Line
You can also use Nuix Console to execute scripts in Ruby, Javascript/ECMAScript, and Python. First
create a Nuix Console wrapper script and then pass it as an argument to the Nuix Console application.
One of the main differences between executing scripts in this mode is that the $current_case variable
is not injected into the script. You will have to open the case directly in this mode.
REM Nuix Console Wrapper Script
SET NUIX="C:\Program Files\Nuix\Nuix 9.10\nuix_console.exe"
SET SCRIPT="C:\Users\windows\Documents\deduplicate.rb"
SET LICENSE_SOURCE="cloud-server"
SET LICENSE_TYPE="enterprise-workstation"
SET JVM_ARGS="-Xmx8g"
SET LOG_DIR="C:\Temp"
SET NUIX_USERNAME="<YOUR_USERNAME>"
SET NUIX_PASSWORD="<YOUR_PASSWORD>"
%NUIX% %JVM_ARGS% -licencesourcetype %LICENSE_SOURCE% -licencetype %LICENSE_TYPE% ^
%SCRIPT% -Dnuix.logdir=%LOG_DIR%