|
0
|
1 <tool id="unixtools_uniq_tool" name="Unique lines">
|
|
1
|
2 <description>assuming sorted input file</description>
|
|
0
|
3 <requirements>
|
|
|
4 <requirement type="package" version="8.21">gnu_coreutils</requirement>
|
|
1
|
5 <requirement type="package" version="4.2.2-sandbox">gnu_sed</requirement>
|
|
0
|
6 </requirements>
|
|
|
7 <command>
|
|
|
8 uniq
|
|
|
9 -f
|
|
|
10 $skipfields
|
|
|
11 $count
|
|
|
12 $repeated
|
|
|
13 $ignorecase
|
|
|
14 $uniqueonly
|
|
|
15 $input
|
|
|
16
|
|
|
17 ## feature is not yet released, it will be in the next 8.22 version
|
|
|
18 ##--group=$group
|
|
1
|
19
|
|
|
20 #if $count:
|
|
|
21 # count will print the count with spaces infrontof the line and
|
|
|
22 # with a space (not a tab) after the number, we need to cahnge that
|
|
|
23 | sed -e 's/ *//' -e 's/ /\t/' > $output
|
|
|
24 #end if
|
|
0
|
25 > $output
|
|
|
26 </command>
|
|
|
27
|
|
|
28 <inputs>
|
|
1
|
29 <param format="txt,tabular" name="input" type="data" label="File to scan for unique values" help="Make sure you have sorted this file" />
|
|
0
|
30
|
|
1
|
31 <param name="count" type="boolean" label="Counting number of occurrences [-c]" help="Prefix lines by the number of occurrences" truevalue="-c" falsevalue="" />
|
|
|
32 <param name="repeated" type="boolean" label="Only print duplicate lines [-d]" truevalue="-d" falsevalue="" />
|
|
|
33 <param name="ignorecase" type="boolean" label="Ignore differences in case when comparing [-i]" truevalue="-i" falsevalue="" />
|
|
|
34 <param name="uniqueonly" type="boolean" label="Only print unique lines [-u]" checked="True" truevalue="-u" falsevalue="" />
|
|
|
35 <param name="skipfields" type="integer" label="Avoid comparing the first N fields [-f]" help="Use zero to start from the first field" size="2" value="0" />
|
|
0
|
36
|
|
|
37 <!--
|
|
|
38 <param name="group" type="select" label="Output all lines, and delimit each unique group.">
|
|
|
39 <option value="separate">Separate unique groups with a single delimiter</option>
|
|
|
40 <option value="prepend">Output a delimiter before each group of unique items</option>
|
|
|
41 <option value="append">Output a delimiter after each group of unique items.</option>
|
|
|
42 <option value="both">Output a delimiter around each group of unique items.</option>
|
|
|
43 </param>
|
|
|
44 -->
|
|
|
45 </inputs>
|
|
|
46
|
|
|
47 <outputs>
|
|
|
48 <data format="input" name="output" metadata_source="input"/>
|
|
|
49 </outputs>
|
|
|
50 <help>
|
|
|
51 This tool takes a sorted file and look for lines that are unique.
|
|
|
52
|
|
|
53 .. class:: warningmark
|
|
|
54
|
|
|
55 Please make sure your file is sorted, or else this tool will give you an erroneous output.
|
|
|
56
|
|
|
57 .. class:: infomark
|
|
|
58
|
|
|
59 You can sort your file using either the "Sort" tool in "Filter and Sort", or the "Sort" tool in "Unix Tools".
|
|
|
60
|
|
|
61 </help>
|
|
|
62 </tool>
|