Remove_Duplicates
Created: 2011-04-21 12:36:37
Last updated: 2011-04-21 13:59:52
This workflow removes any duplicates from a list of inputs, merges the unique values, and then removes any null values.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (1)
Remove Duplicates, Merge, Remove Nulls |
Descriptions (1)
This workflow removes any duplicates from a list of inputs, merges the unique values, and then removes any null values. |
Dependencies (0)
Processors (5)
Name |
Type |
Description |
regular_expression |
stringconstant |
Value\n |
Remove_duplicate_strings |
localworker |
ScriptList strippedlist = new ArrayList();
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
if (strippedlist.contains(item) == false) {
strippedlist.add(item);
}
}
|
Split_string_into_string_list_by_regular_expression |
localworker |
ScriptList split = new ArrayList();
if (!string.equals("")) {
String regexString = ",";
if (regex != void) {
regexString = regex;
}
String[] result = string.split(regexString);
for (int i = 0; i < result.length; i++) {
split.add(result[i]);
}
}
|
remove_Nulls |
beanshell |
ScriptString[] split = input.split("\n");
Vector nonEmpty = new Vector();
for (int i = 0; i < split.length; i++){
if (!(split[i].equals("")))
{
nonEmpty.add(split[i].trim());
}
}
String[] non_empty = new String[nonEmpty.size()];
for (int i = 0; i < non_empty.length; i ++)
{
non_empty[i] = nonEmpty.elementAt(i);
}
String output = "";
for (int i = 0; i < non_empty.length; i++)
{
output = output + (String) (non_empty[i] + "\n");
} |
Merge_string_list_to_string |
localworker |
ScriptString seperatorString = "\n";
if (seperator != void) {
seperatorString = seperator;
}
StringBuffer sb = new StringBuffer();
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
sb.append(item);
if (i.hasNext()) {
sb.append(seperatorString);
}
}
concatenated = sb.toString();
|
Beanshells (1)
Name |
Description |
Inputs |
Outputs |
remove_Nulls |
|
input
|
output
|
Datalinks (6)
Source |
Sink |
Split_string_into_string_list_by_regular_expression:split |
Remove_duplicate_strings:stringlist |
input |
Split_string_into_string_list_by_regular_expression:string |
regular_expression:value |
Split_string_into_string_list_by_regular_expression:regex |
Merge_string_list_to_string:concatenated |
remove_Nulls:input |
Remove_duplicate_strings:strippedlist |
Merge_string_list_to_string:stringlist |
remove_Nulls:output |
output |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (0)
None
Featured In Packs (0)
None
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (0)
No comments yet
Log in to make a comment