view diff.xml @ 0:8a18547725cf draft

"planemo upload for repository commit 9b11cc5751c0931172d00799b246fcbd63660311"
author bgruening
date Tue, 31 Mar 2020 16:36:28 -0400
children 02dfbbf869d8
line wrap: on
line source

<tool id="diff" name="diff" version="3.6+galaxy0">

    <description>analyzes two files and generates a text file with information about the lines that are different</description>

        <requirement type="package" version="3.6">diffutils</requirement>

        <exit_code range="2:" level="fatal" description="Something went wrong trying to check differences in files. Please check output log for more details." />
        <regex match="diff: memory exhausted" source="stdout" level="fatal_oom" description="Out of memory error occurred" />

    <command ><![CDATA[
        diff -u '$input1' '$input2' > '$output1'

        <param name="input1" type="data" format="txt" label="First input file" />
        <param name="input2" type="data" format="txt" label="Second input file" />

        <data name="output1" format="txt" />

        <test expect_exit_code="0" expect_failure="false">
            <param name="input1" value="file1.txt" />
            <param name="input2" value="file1.txt" />
            <output name="output1">
                    <has_n_lines n="0" />
        <test expect_exit_code="1" expect_failure="false">
            <param name="input1" value="file1.txt" />
            <param name="input2" value="file2.txt" />
            <output name="output1">
                    <has_n_lines n="5" />
                    <has_line line=" a" />
                    <has_line line="+b" />

.. class:: infomark


The **diff** utility is a data comparison tool that calculates and displays the differences between two files.

Unlike edit distance notions used for other purposes, diff is line-oriented rather than character-oriented, but it is like Levenshtein distance in that it tries to determine the smallest set of deletions and insertions to create one file from the other.

The diff command displays the changes made in a standard format, such that both humans and machines can understand the changes and apply them: given one file and the changes, the other file can be created.

.. class:: infomark


Two text files to be checked for differences line by line.

.. class:: infomark


A *single text file*, either:

- containing the lines differences in **unified format** (*unidiff*),

- or an **empty** file if the two input files are the same.

        <citation type="bibtex">
            author = {The Free Software Foundation (FSF), Inc},
            year = {2017},
            title = {diff (GNU diffutils)},
            publisher = {The Free Software Foundation (FSF), Inc},
            url = {},