Extract DEC and RA from whitespace separated file
Created: 2012-05-10 14:40:38
Last updated: 2012-09-24 16:13:28
Given an input like:
1 0.77345 -1.91430
2 0.83487 29.79720
3 0.84108 30.78210
4 0.99487 20.75240
this workflow extracts the second and third column as RA and DEC.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (0)
Titles (0)
Descriptions (0)
Dependencies (0)
Processors (9)
Name |
Type |
Description |
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]);
}
}
|
regex_value |
stringconstant |
Value\n |
Filter_list_of_strings_extracting_match_to_a_regex |
localworker |
Scriptimport java.util.regex.*;
filteredlist = new ArrayList();
Pattern thePat = Pattern.compile(regex);
int theGroup = Integer.parseInt(group);
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
Matcher matcher = thePat.matcher(item);
if (matcher.find()) {
filteredlist.add(matcher.group(theGroup));
}
}
|
regex_value_1 |
stringconstant |
Value(\S*)\s(\S*)\s(\S*) |
DEC_COLUMN |
stringconstant |
Value3 |
Filter_list_of_strings_extracting_match_to_a_regex_2 |
localworker |
Scriptimport java.util.regex.*;
filteredlist = new ArrayList();
Pattern thePat = Pattern.compile(regex);
int theGroup = Integer.parseInt(group);
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
Matcher matcher = thePat.matcher(item);
if (matcher.find()) {
filteredlist.add(matcher.group(theGroup));
}
}
|
RA_COLUMN |
stringconstant |
Value2 |
ID_COLUMN |
stringconstant |
Value2 |
Filter_list_of_strings_extracting_match_to_a_regex_2_2 |
localworker |
Scriptimport java.util.regex.*;
filteredlist = new ArrayList();
Pattern thePat = Pattern.compile(regex);
int theGroup = Integer.parseInt(group);
for (Iterator i = stringlist.iterator(); i.hasNext();) {
String item = (String) i.next();
Matcher matcher = thePat.matcher(item);
if (matcher.find()) {
filteredlist.add(matcher.group(theGroup));
}
}
|
Datalinks (13)
Source |
Sink |
regex_value:value |
Split_string_into_string_list_by_regular_expression:regex |
data |
Split_string_into_string_list_by_regular_expression:string |
Split_string_into_string_list_by_regular_expression:split |
Filter_list_of_strings_extracting_match_to_a_regex:stringlist |
regex_value_1:value |
Filter_list_of_strings_extracting_match_to_a_regex:regex |
DEC_COLUMN:value |
Filter_list_of_strings_extracting_match_to_a_regex:group |
regex_value_1:value |
Filter_list_of_strings_extracting_match_to_a_regex_2:regex |
Split_string_into_string_list_by_regular_expression:split |
Filter_list_of_strings_extracting_match_to_a_regex_2:stringlist |
RA_COLUMN:value |
Filter_list_of_strings_extracting_match_to_a_regex_2:group |
ID_COLUMN:value |
Filter_list_of_strings_extracting_match_to_a_regex_2_2:group |
regex_value_1:value |
Filter_list_of_strings_extracting_match_to_a_regex_2_2:regex |
Split_string_into_string_list_by_regular_expression:split |
Filter_list_of_strings_extracting_match_to_a_regex_2_2:stringlist |
Filter_list_of_strings_extracting_match_to_a_regex:filteredlist |
DEC |
Filter_list_of_strings_extracting_match_to_a_regex_2:filteredlist |
RA |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1 (earliest)
(of 2)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (1)
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