| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
<html> |
| 3 |
<!-- |
| 4 |
"...und der eignen Kraft vertrauend steigt ein frei Geschlecht empor!" |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
This manual describes how to install and use Numdiff, |
| 9 |
a program which compares |
| 10 |
putatively similar files line by line and field by field, |
| 11 |
ignoring small numeric differences or/and different numeric formats. |
| 12 |
|
| 13 |
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Ivano Primi ivprimi(at)libero(dot)it |
| 14 |
|
| 15 |
Permission is granted to copy, distribute and/or modify this |
| 16 |
document under the terms of the GNU Free Documentation License, Version |
| 17 |
1.3 or any later version published by the Free Software Foundation; |
| 18 |
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. |
| 19 |
A copy of the license is included in GNU Free Documentation License. --> |
| 20 |
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ --> |
| 21 |
<head> |
| 22 |
<title>Numdiff Manual 5.9</title> |
| 23 |
|
| 24 |
<meta name="description" content="Numdiff Manual 5.9"> |
| 25 |
<meta name="keywords" content="Numdiff Manual 5.9"> |
| 26 |
<meta name="resource-type" content="document"> |
| 27 |
<meta name="distribution" content="global"> |
| 28 |
<meta name="Generator" content="makeinfo"> |
| 29 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 30 |
<link href="#Top" rel="start" title="Top"> |
| 31 |
<link href="#Index" rel="index" title="Index"> |
| 32 |
<link href="#SEC_Contents" rel="contents" title="Table of Contents"> |
| 33 |
<link href="dir.html#Top" rel="up" title="(dir)"> |
| 34 |
<style type="text/css"> |
| 35 |
<!-- |
| 36 |
a.summary-letter {text-decoration: none} |
| 37 |
blockquote.smallquotation {font-size: smaller} |
| 38 |
div.display {margin-left: 3.2em} |
| 39 |
div.example {margin-left: 3.2em} |
| 40 |
div.indentedblock {margin-left: 3.2em} |
| 41 |
div.lisp {margin-left: 3.2em} |
| 42 |
div.smalldisplay {margin-left: 3.2em} |
| 43 |
div.smallexample {margin-left: 3.2em} |
| 44 |
div.smallindentedblock {margin-left: 3.2em; font-size: smaller} |
| 45 |
div.smalllisp {margin-left: 3.2em} |
| 46 |
kbd {font-style:oblique} |
| 47 |
pre.display {font-family: inherit} |
| 48 |
pre.format {font-family: inherit} |
| 49 |
pre.menu-comment {font-family: serif} |
| 50 |
pre.menu-preformatted {font-family: serif} |
| 51 |
pre.smalldisplay {font-family: inherit; font-size: smaller} |
| 52 |
pre.smallexample {font-size: smaller} |
| 53 |
pre.smallformat {font-family: inherit; font-size: smaller} |
| 54 |
pre.smalllisp {font-size: smaller} |
| 55 |
span.nocodebreak {white-space:nowrap} |
| 56 |
span.nolinebreak {white-space:nowrap} |
| 57 |
span.roman {font-family:serif; font-weight:normal} |
| 58 |
span.sansserif {font-family:sans-serif; font-weight:normal} |
| 59 |
ul.no-bullet {list-style: none} |
| 60 |
--> |
| 61 |
</style> |
| 62 |
|
| 63 |
|
| 64 |
</head> |
| 65 |
|
| 66 |
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> |
| 67 |
<h1 class="settitle" align="center">Numdiff Manual 5.9</h1> |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
<a name="SEC_Contents"></a> |
| 73 |
<h2 class="contents-heading">Table of Contents</h2> |
| 74 |
|
| 75 |
<div class="contents"> |
| 76 |
|
| 77 |
<ul class="no-bullet"> |
| 78 |
<li><a name="toc-Copying-1" href="#Copying">1 Copying</a></li> |
| 79 |
<li><a name="toc-Acknowledgments-1" href="#Acknowledgments">2 Acknowledgments</a></li> |
| 80 |
<li><a name="toc-Overview-1" href="#Overview">3 Overview</a> |
| 81 |
<ul class="no-bullet"> |
| 82 |
<li><a name="toc-Output-format-1" href="#Output-format">3.1 Output format</a></li> |
| 83 |
<li><a name="toc-Overview-mode-1" href="#Overview-mode">3.2 Overview mode</a></li> |
| 84 |
<li><a name="toc-Output-of-the-filter" href="#Filter-output">3.3 Output of the filter</a></li> |
| 85 |
<li><a name="toc-Raw-output-1" href="#Raw-output">3.4 Raw output</a></li> |
| 86 |
</ul></li> |
| 87 |
<li><a name="toc-Installing-1" href="#Installing">4 Installing</a></li> |
| 88 |
<li><a name="toc-Invoking-numdiff-1" href="#Invoking-numdiff">5 Invoking numdiff</a></li> |
| 89 |
<li><a name="toc-Selecting-lines-and-fields-for-the-comparison" href="#ndselect">6 Selecting lines and fields for the comparison</a></li> |
| 90 |
<li><a name="toc-Invoking-ndselect-1" href="#Invoking-ndselect">7 Invoking ndselect</a></li> |
| 91 |
<li><a name="toc-Using-the-filter-of-numdiff" href="#Filtering">8 Using the filter of numdiff</a></li> |
| 92 |
<li><a name="toc-Warnings-1" href="#Warnings">9 Warnings</a></li> |
| 93 |
<li><a name="toc-GNU-Free-Documentation-License-1" href="#GNU-Free-Documentation-License">Appendix A GNU Free Documentation License</a></li> |
| 94 |
<li><a name="toc-Index-1" href="#Index">Index</a></li> |
| 95 |
</ul> |
| 96 |
</div> |
| 97 |
|
| 98 |
|
| 99 |
<a name="Top"></a> |
| 100 |
<div class="header"> |
| 101 |
<p> |
| 102 |
Next: <a href="#Copying" accesskey="n" rel="next">Copying</a>, Previous: <a href="dir.html#Top" accesskey="p" rel="prev">(dir)</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 103 |
</div> |
| 104 |
<a name="Numdiff-User-Manual"></a> |
| 105 |
<h1 class="top">Numdiff User Manual</h1> |
| 106 |
|
| 107 |
|
| 108 |
<p><em>“...und der eignen Kraft vertrauend steigt ein frei Geschlecht empor!”</em> |
| 109 |
</p><br> |
| 110 |
<br> |
| 111 |
|
| 112 |
<p>This manual describes how to install and use Numdiff, |
| 113 |
a program which compares |
| 114 |
putatively similar files line by line and field by field, |
| 115 |
ignoring small numeric differences or/and different numeric formats. |
| 116 |
</p> |
| 117 |
<p>Copyright © 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Ivano Primi <a href="mailto:ivprimi(at)libero(dot)it">ivprimi(at)libero(dot)it</a> |
| 118 |
</p> |
| 119 |
<blockquote> |
| 120 |
<p>Permission is granted to copy, distribute and/or modify this |
| 121 |
document under the terms of the GNU Free Documentation License, Version |
| 122 |
1.3 or any later version published by the Free Software Foundation; |
| 123 |
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. |
| 124 |
A copy of the license is included in <a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a>. |
| 125 |
</p></blockquote> |
| 126 |
|
| 127 |
|
| 128 |
<table class="menu" border="0" cellspacing="0"> |
| 129 |
<tr><td align="left" valign="top">• <a href="#Copying" accesskey="1">Copying</a>:</td><td> </td><td align="left" valign="top">Numdiff Copying Conditions (GPL) |
| 130 |
</td></tr> |
| 131 |
<tr><td align="left" valign="top">• <a href="#Acknowledgments" accesskey="2">Acknowledgments</a>:</td><td> </td><td align="left" valign="top">Acknowledgments |
| 132 |
</td></tr> |
| 133 |
<tr><td align="left" valign="top">• <a href="#Overview" accesskey="3">Overview</a>:</td><td> </td><td align="left" valign="top">Introduction to numdiff |
| 134 |
</td></tr> |
| 135 |
<tr><td align="left" valign="top">• <a href="#Installing" accesskey="4">Installing</a>:</td><td> </td><td align="left" valign="top">How to install numdiff |
| 136 |
</td></tr> |
| 137 |
<tr><td align="left" valign="top">• <a href="#Invoking-numdiff" accesskey="5">Invoking numdiff</a>:</td><td> </td><td align="left" valign="top">How to use numdiff |
| 138 |
</td></tr> |
| 139 |
<tr><td align="left" valign="top">• <a href="#ndselect" accesskey="6">ndselect</a>:</td><td> </td><td align="left" valign="top">(numdiff) ndselect. Selecting lines and fields |
| 140 |
</td></tr> |
| 141 |
<tr><td align="left" valign="top">• <a href="#Invoking-ndselect" accesskey="7">Invoking ndselect</a>:</td><td> </td><td align="left" valign="top">How to use ndselect |
| 142 |
</td></tr> |
| 143 |
<tr><td align="left" valign="top">• <a href="#Filtering" accesskey="8">Filtering</a>:</td><td> </td><td align="left" valign="top">How to use the filter of numdiff |
| 144 |
</td></tr> |
| 145 |
<tr><td align="left" valign="top">• <a href="#Warnings" accesskey="9">Warnings</a>:</td><td> </td><td align="left" valign="top">Various recommendations |
| 146 |
</td></tr> |
| 147 |
<tr><td align="left" valign="top">• <a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a>:</td><td> </td><td align="left" valign="top">The license covering this document |
| 148 |
</td></tr> |
| 149 |
<tr><td align="left" valign="top">• <a href="#Index">Index</a>:</td><td> </td><td align="left" valign="top">Complete index |
| 150 |
</td></tr> |
| 151 |
</table> |
| 152 |
|
| 153 |
|
| 154 |
<hr> |
| 155 |
<a name="Copying"></a> |
| 156 |
<div class="header"> |
| 157 |
<p> |
| 158 |
Next: <a href="#Acknowledgments" accesskey="n" rel="next">Acknowledgments</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 159 |
</div> |
| 160 |
<a name="Copying-1"></a> |
| 161 |
<h2 class="chapter">1 Copying</h2> |
| 162 |
|
| 163 |
<a name="index-Copying-Conditions"></a> |
| 164 |
<a name="index-License"></a> |
| 165 |
<a name="index-GNU-General-Public-License"></a> |
| 166 |
<a name="index-GPL"></a> |
| 167 |
|
| 168 |
<p>Numdiff (also written numdiff) is free software: |
| 169 |
you can redistribute it and/or modify |
| 170 |
it under the terms of the GNU General Public License |
| 171 |
as published by the Free Software Foundation, |
| 172 |
either version 3 of the License, or |
| 173 |
(at your option) any later version. |
| 174 |
</p> |
| 175 |
<p>Numdiff is distributed in the hope that it will be useful, |
| 176 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 177 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 178 |
GNU General Public License for more details. |
| 179 |
</p> |
| 180 |
<p>You should have received a copy of the GNU General Public License |
| 181 |
along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>. |
| 182 |
</p> |
| 183 |
<hr> |
| 184 |
<a name="Acknowledgments"></a> |
| 185 |
<div class="header"> |
| 186 |
<p> |
| 187 |
Next: <a href="#Overview" accesskey="n" rel="next">Overview</a>, Previous: <a href="#Copying" accesskey="p" rel="prev">Copying</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 188 |
</div> |
| 189 |
<a name="Acknowledgments-1"></a> |
| 190 |
<h2 class="chapter">2 Acknowledgments</h2> |
| 191 |
|
| 192 |
<a name="index-Acknowledgments"></a> |
| 193 |
<a name="index-Thanks"></a> |
| 194 |
|
| 195 |
<p>I want to thank Mr. Norman Clerman <a href="mailto:norm(dot)opcon(at)fuse(dot)net">norm(dot)opcon(at)fuse(dot)net</a> |
| 196 |
for several suggestions he gave me to improve the readability |
| 197 |
and the effectiveness of the output produced by Numdiff. |
| 198 |
He also pointed out the need to implement a filter |
| 199 |
to resynchronize the lines between two files in case of |
| 200 |
addition or deletion of one or more lines. |
| 201 |
I have to give him credit for the urge to prepare the |
| 202 |
versions 4.x and 5.x of Numdiff. |
| 203 |
</p> |
| 204 |
<p>Moreover, I want to thank my friends Mariapia Palombaro, |
| 205 |
since she removed some errors while |
| 206 |
reviewing the first version of this document, and |
| 207 |
Paolo Caramanica, who suggested me to add more |
| 208 |
information to the output of the option <samp>-S</samp>. |
| 209 |
</p> |
| 210 |
<hr> |
| 211 |
<a name="Overview"></a> |
| 212 |
<div class="header"> |
| 213 |
<p> |
| 214 |
Next: <a href="#Installing" accesskey="n" rel="next">Installing</a>, Previous: <a href="#Acknowledgments" accesskey="p" rel="prev">Acknowledgments</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 215 |
</div> |
| 216 |
<a name="Overview-1"></a> |
| 217 |
<h2 class="chapter">3 Overview</h2> |
| 218 |
|
| 219 |
<a name="index-Introduction"></a> |
| 220 |
<a name="index-Usage-of-numdiff"></a> |
| 221 |
<a name="index-Purposes"></a> |
| 222 |
<a name="index-How-to-use-numdiff"></a> |
| 223 |
|
| 224 |
<p>Computer users often find occasion to ask how two files differ. |
| 225 |
Perhaps one file is a newer version of the other file. Or maybe the |
| 226 |
two files started out as identical copies but were changed by different |
| 227 |
people. |
| 228 |
</p> |
| 229 |
<p>There are several ways to look at the differences between two |
| 230 |
files. One way consists in looking at the series of lines |
| 231 |
that were deleted from, inserted in, or changed in one file to produce |
| 232 |
the other file. |
| 233 |
The well-known <code>diff</code> program compares two files line by line, |
| 234 |
finds groups of lines that differ, and reports each group of differing lines. |
| 235 |
Without particular options, when comparing lines |
| 236 |
the <code>diff</code> program considers any |
| 237 |
change in the amount or in the type of the characters as a |
| 238 |
difference. However, trough some command line options |
| 239 |
the user can suppress the output of certain kinds of |
| 240 |
differences that are not important to him. |
| 241 |
For instance, <code>diff</code> provides options to ignore differences |
| 242 |
in the amount of white space between words or lines, or |
| 243 |
differences in alphabetic case. |
| 244 |
</p> |
| 245 |
<p>Another way to look at the differences between two files consists |
| 246 |
in considering the words that were deleted from, inserted in, or changed |
| 247 |
in one file to produce the other file. |
| 248 |
Here “word” refers to a sequence of non white-space characters |
| 249 |
delimited by a couple of white-spaces, one before and the other |
| 250 |
one after the word. |
| 251 |
</p> |
| 252 |
<p>The <code>wdiff</code> program by François Pinard |
| 253 |
<a href="mailto:pinard(at)iro(dot)umontreal(dot)ca">pinard(at)iro(dot)umontreal(dot)ca</a> |
| 254 |
compares words in two files and reports the differences. |
| 255 |
</p> |
| 256 |
<p>Finally, one can regard the differences between two files as a |
| 257 |
sequence of pairs of differing bytes. |
| 258 |
The <code>cmp</code> program reports the differences between two files |
| 259 |
byte by byte, instead of line by line or word by word. |
| 260 |
As a result, it is often more useful than <code>diff</code> or <code>wdiff</code> |
| 261 |
for comparing binary files. |
| 262 |
</p> |
| 263 |
<p>However, none of these approaches turns out to be good when |
| 264 |
you want to compare a couple of text files composed |
| 265 |
partially or entirely by numerical fields. |
| 266 |
In such a case what you want to obtain usually is a list of the numerical fields |
| 267 |
in the second file which <strong>numerically</strong> differ |
| 268 |
from the corresponding fields in the first file. |
| 269 |
But, while a number can be written using different notations, |
| 270 |
programs like <code>diff</code> or <code>wdiff</code> |
| 271 |
can not recognize whether a difference between two numeric fields |
| 272 |
is only due to the notation or is actually a difference of numerical |
| 273 |
values. |
| 274 |
</p> |
| 275 |
<p>For instance, 11.23 and 11.2300000 |
| 276 |
are the same number but represented in different ways. |
| 277 |
If you are interested in the numerical values, |
| 278 |
the difference in the representation is not meaningful |
| 279 |
and then should be ignored. However, <code>diff</code> and <code>wdiff</code> |
| 280 |
always consider the previous one as an actual difference: there |
| 281 |
is no way for you to tell these programs to ignore it. |
| 282 |
</p> |
| 283 |
<p>Another example of this type is given by |
| 284 |
98765.4321 and 9.87654321E04. |
| 285 |
Here the difference is only due to the use |
| 286 |
of the scientific notation in place of the ordinary decimal notation. |
| 287 |
</p> |
| 288 |
<p>In addition, depending on your country you could stick |
| 289 |
to different conventions in writing numbers. |
| 290 |
For example, the amount “three hundred millions and |
| 291 |
fifty-two thousands of dollars and forty-six cents” |
| 292 |
is usually written by an Italian accountant as 300.052.000,46$ |
| 293 |
while an American accountant would write 300,052,000.46$. |
| 294 |
Of course, 300.052.000,46$ and 300,052,000.46$ |
| 295 |
represent the same amount of money but |
| 296 |
<code>diff</code> and <code>wdiff</code> would report a difference, |
| 297 |
which probably is not what you want in such a case. |
| 298 |
</p> |
| 299 |
<p>Lastly, sometimes you could wish to ignore even |
| 300 |
differences in numerical values as long as they do not |
| 301 |
exceed a certain threshold. In other words, |
| 302 |
you could desire to suppress the report of all “small” |
| 303 |
numerical differences. |
| 304 |
</p> |
| 305 |
<p>For example, it could happen that you want to ignore |
| 306 |
all numerical differences whose absolute value is |
| 307 |
not greater than 0.0001. If this is the case, then |
| 308 |
the numerical fields 33 and 33.00009 |
| 309 |
should be considered equal, while 33 and 33.00011 |
| 310 |
should be reported as different. |
| 311 |
</p> |
| 312 |
<p>However, <code>diff</code> and <code>wdiff</code> can not be used |
| 313 |
to ignore small numerical differences, since they |
| 314 |
do not even know what a numerical difference is. |
| 315 |
</p> |
| 316 |
<p>These are the reasons why I decided to implement a new program with |
| 317 |
the capability to appropriately compare files containing numerical fields. |
| 318 |
In writing this program I was inspired by <code>ndiff</code>, |
| 319 |
a GPL’ed software by Nelson H. Baabe of the Salt Lake |
| 320 |
City University. <code>ndiff</code> is actually a good tool, |
| 321 |
and I used it for a while. But I did not |
| 322 |
completely like the way it works, and so <code>numdiff</code> was conceived. |
| 323 |
Although <code>ndiff</code> inspired <code>numdiff</code>, they are completely |
| 324 |
different from the viewpoint of the source code: |
| 325 |
<code>numdiff</code> has been entirely written from scratch |
| 326 |
with the addition of code coming from GNU bc, GNU diff |
| 327 |
and GNUlib. |
| 328 |
In addition, the last versions of Numdiff offer much more |
| 329 |
features than <code>ndiff</code> does. |
| 330 |
</p> |
| 331 |
<p><code>numdiff</code> can be used to compare putatively similar files |
| 332 |
line by line and field by field, ignoring small numeric differences |
| 333 |
or/and different numeric formats. |
| 334 |
<code>numdiff</code> takes two mandatory arguments, the paths of the |
| 335 |
two files to compare, and, after splitting them into lines |
| 336 |
and the lines into fields |
| 337 |
according to a given list of field delimiters, it compares |
| 338 |
every field of every line of the first file with |
| 339 |
the corresponding field of the second file. |
| 340 |
What <em>corresponding</em> here exactly means |
| 341 |
depends on the options passed to the program on |
| 342 |
the command line. With no options, corresponding |
| 343 |
means the field of the second file at the same position, |
| 344 |
where position refers both to the line number and to the |
| 345 |
location within the line. |
| 346 |
If the compared fields are both legal numerical values, |
| 347 |
then <code>numdiff</code> performs a numerical comparison |
| 348 |
between them, otherwise it performs a literal comparison, |
| 349 |
i.e. the usual byte-by-byte comparison. |
| 350 |
In case of literal comparison, two fields are regarded |
| 351 |
as equal if they are formed by the same sequence |
| 352 |
of characters. |
| 353 |
In case of numerical comparison and without specific |
| 354 |
command line options, two fields are regarded as equal |
| 355 |
if their numerical difference is zero. |
| 356 |
Mind that, if you do not explicitly |
| 357 |
specify a list of field delimiters by means of the option <samp>-s</samp> |
| 358 |
or <samp>-D</samp>, <code>numdiff</code> takes as field delimiters |
| 359 |
the characters newline (‘<samp>\n</samp>’, ASCII code 0x0A), |
| 360 |
horizontal tabulation (‘<samp>\t</samp>’, ASCII code 0x09), |
| 361 |
and blank (‘<samp> </samp>’, ASCII code 0x20). |
| 362 |
</p> |
| 363 |
<p>For example, if the file <samp>list1</samp> contains the data |
| 364 |
</p><pre class="verbatim">accident 123 23Joshua 34.55 +3+4i water |
| 365 |
dog -3455.321 cat 2.345678e-9 .0005-6.23e2i |
| 366 |
|
| 367 |
</pre> |
| 368 |
<p>and file <samp>list2</samp> contains the data |
| 369 |
</p> |
| 370 |
<pre class="verbatim">Accident 123 23456 34.5500 +3.0001+4i |
| 371 |
dog -3455.320098 Cat +2.345678e-9 -6.23e2i $$$ |
| 372 |
A new line |
| 373 |
|
| 374 |
</pre> |
| 375 |
<p>then the output of the command ‘<samp>numdiff list1 list2</samp>’ will be: |
| 376 |
</p> |
| 377 |
<div class="example"> |
| 378 |
<pre class="example">---------------- |
| 379 |
##1 #:1 <== accident |
| 380 |
##1 #:1 ==> Accident |
| 381 |
@ @@ |
| 382 |
##1 #:3 <== 23Joshua |
| 383 |
##1 #:3 ==> 23456 |
| 384 |
@ @@ |
| 385 |
##1 #:5 <== +3+4i |
| 386 |
##1 #:5 ==> +3.0001+4i |
| 387 |
@ Absolute error = 1.0000000000e-4, Relative error = 2.0000000000e-5 |
| 388 |
##1 #>6 <== water |
| 389 |
##1 ==> |
| 390 |
@ Line 1 in file "list2" is shorter than expected! |
| 391 |
---------------- |
| 392 |
##2 #:2 <== -3455.321 |
| 393 |
##2 #:2 ==> -3455.320098 |
| 394 |
@ Absolute error = 9.0200000000e-4, Relative error = 2.6104672633e-7 |
| 395 |
##2 #:3 <== cat |
| 396 |
##2 #:3 ==> Cat |
| 397 |
@ @@ |
| 398 |
##2 #:5 <== .0005-6.23e2i |
| 399 |
##2 #:5 ==> -6.23e2i |
| 400 |
@ Absolute error = 5.0000000000e-4, Relative error = 8.0256821830e-7 |
| 401 |
##2 <== |
| 402 |
##2 #>6 ==> $$$ |
| 403 |
@ Line 2 in file "list1" is shorter than expected! |
| 404 |
---------------- |
| 405 |
##3 <== |
| 406 |
##3 #>1 ==> A new line |
| 407 |
@ Line 3 in file "list1" is shorter than expected! |
| 408 |
---------------- |
| 409 |
<== |
| 410 |
##4 ==> |
| 411 |
|
| 412 |
|
| 413 |
+++ File "list1" differs from file "list2" |
| 414 |
</pre></div> |
| 415 |
|
| 416 |
<p>At the same time <code>numdiff</code> will print the following error message |
| 417 |
on stderr: |
| 418 |
</p><div class="example"> |
| 419 |
<pre class="example">*** End of file "list1" reached while trying to read line 4. |
| 420 |
File "list2" has more lines than file "list1", |
| 421 |
line 4 is the last one read from file "list2" |
| 422 |
</pre></div> |
| 423 |
|
| 424 |
<p>It is worth remarking that <code>numdiff</code> can recognize complex numbers, |
| 425 |
provided that they are written in the form <em>a+bi</em> or |
| 426 |
<em>a-bi</em> with no extra characters between the values <em>a</em>, <em>b</em> and |
| 427 |
the sign <em>+</em> or <em>-</em> (the symbol <em>i</em>, |
| 428 |
used to represent the imaginary unit, can be changed by a suitable |
| 429 |
command line option, see <a href="#Invoking-numdiff">Invoking numdiff</a>). |
| 430 |
Do not worry if you do not know what complex numbers are: |
| 431 |
probably you will never manage files containing complex numbers, |
| 432 |
thus you can live happily without them. :) |
| 433 |
</p> |
| 434 |
<p>We consider now an example which shows how Numdiff can |
| 435 |
resynchronize the lines between two files in case of addition or deletion |
| 436 |
of one or more lines. |
| 437 |
The versions of Numdiff prior to 5 did not work well if |
| 438 |
one of the two files to compare contains |
| 439 |
in the middle some lines more or less than the other one. |
| 440 |
For instance, if you have one file that is 1000 lines long that you |
| 441 |
are comparing to a second file 1001 lines long, and except for that one |
| 442 |
extra line, located, let us say, at line 500, the files are identical, |
| 443 |
then <code>numdiff</code> version 4.x does <strong>not</strong> show only the one line difference: |
| 444 |
once the files are out of synchronization <code>numdiff</code> 4.x reports |
| 445 |
every line as different. |
| 446 |
Since version 5 it is possible in such cases to activate a filter which handles |
| 447 |
additions and deletions of lines. |
| 448 |
There are several options ruling how the filter |
| 449 |
actually works, and I will give later a detailed explanation |
| 450 |
on how to use them to obtain each time the wished result. |
| 451 |
The simplest way to activate the filter consists in |
| 452 |
using the option <samp>-z @</samp>. |
| 453 |
If <samp>bill1</samp> and <samp>bill2</samp> are given by |
| 454 |
</p><pre class="verbatim"> Month Expenses |
| 455 |
------------------------- |
| 456 |
Jan09 $ 233.56 |
| 457 |
Feb09 $ 850.77 |
| 458 |
Mar09 $ 12.55 |
| 459 |
Apr09 $ 524.00 |
| 460 |
May09 $ 78.25 |
| 461 |
Jun09 $ 230.00 |
| 462 |
Jul09 $ 443.10 |
| 463 |
Aug09 $ 67.65 |
| 464 |
Sep09 $ 10.00 |
| 465 |
Oct09 $ 201.45 |
| 466 |
Nov09 $ 110.00 |
| 467 |
Dec09 $ 200.27 |
| 468 |
------------------------- |
| 469 |
Total $ 2961.60 |
| 470 |
</pre> |
| 471 |
<p>and |
| 472 |
</p> |
| 473 |
<pre class="verbatim"> Month Expenses |
| 474 |
Jan09 $ 234.00 |
| 475 |
Mar09 $ 13.00 |
| 476 |
May09 $ 78.25 |
| 477 |
Jul09 $ 443.10 |
| 478 |
Sep09 $ 10.00 |
| 479 |
Nov09 $ 110.00 |
| 480 |
Jan10 $ 200.00 |
| 481 |
------------------------- |
| 482 |
|
| 483 |
Total $ 1088.35 |
| 484 |
</pre> |
| 485 |
<p>respectively, then the differences between the two files are: |
| 486 |
</p><ul> |
| 487 |
<li> the insertion of the separator <tt>-------------------------</tt> |
| 488 |
in <samp>bill1</samp> before the list of the months, |
| 489 |
</li><li> the deletion in <samp>bill2</samp> of the lines |
| 490 |
related to the expenses for the months February, |
| 491 |
April, June, August, October, December, |
| 492 |
</li><li> small changes in <samp>bill2</samp> to the expenses |
| 493 |
of the months January 2009 and March, |
| 494 |
</li><li> the presence in <samp>bill2</samp> of an entry for January 2010 |
| 495 |
just before the separator <tt>-------------------------</tt>, |
| 496 |
</li><li> the addition of an empty line to <samp>bill2</samp> after the separator |
| 497 |
<tt>-------------------------</tt>, |
| 498 |
</li><li> and the different values for the total sum of the expenses. |
| 499 |
</li></ul> |
| 500 |
|
| 501 |
<p>The output of the command ‘<samp>numdiff -z @ -V bill1 bill2</samp>’ |
| 502 |
(I have added here the option <samp>-V</samp> to let Numdiff show |
| 503 |
which couples of lines it is comparing each time) |
| 504 |
shows exactly the expected differences: |
| 505 |
<a name="command"></a></p><div class="example"> |
| 506 |
<pre class="example"> |
| 507 |
---------------- |
| 508 |
##2 <== ------------------------- |
| 509 |
==> |
| 510 |
|
| 511 |
---------------- |
| 512 |
##3 <== Jan09 $ 233.56 |
| 513 |
##2 ==> Jan09 $ 234.00 |
| 514 |
|
| 515 |
##3 #:3 <== 233.56 |
| 516 |
##2 #:3 ==> 234.00 |
| 517 |
@ Absolute error = 4.4000000000e-1, Relative error = 1.8838842268e-3 |
| 518 |
---------------- |
| 519 |
##4 <== Feb09 $ 850.77 |
| 520 |
==> |
| 521 |
|
| 522 |
---------------- |
| 523 |
##5 <== Mar09 $ 12.55 |
| 524 |
##3 ==> Mar09 $ 13.00 |
| 525 |
|
| 526 |
##5 #:3 <== 12.55 |
| 527 |
##3 #:3 ==> 13.00 |
| 528 |
@ Absolute error = 4.5000000000e-1, Relative error = 3.5856573705e-2 |
| 529 |
---------------- |
| 530 |
##6 <== Apr09 $ 524.00 |
| 531 |
==> |
| 532 |
|
| 533 |
---------------- |
| 534 |
##8 <== Jun09 $ 230.00 |
| 535 |
==> |
| 536 |
|
| 537 |
---------------- |
| 538 |
##10 <== Aug09 $ 67.65 |
| 539 |
==> |
| 540 |
|
| 541 |
---------------- |
| 542 |
##12 <== Oct09 $ 201.45 |
| 543 |
==> |
| 544 |
|
| 545 |
---------------- |
| 546 |
##14 <== Dec09 $ 200.27 |
| 547 |
##8 ==> Jan10 $ 200.00 |
| 548 |
|
| 549 |
##14 #:1 <== Dec09 |
| 550 |
##8 #:1 ==> Jan10 |
| 551 |
@ @@ |
| 552 |
##14 #:3 <== 200.27 |
| 553 |
##8 #:3 ==> 200.00 |
| 554 |
@ Absolute error = 2.7000000000e-1, Relative error = 1.3500000000e-3 |
| 555 |
---------------- |
| 556 |
<== |
| 557 |
##10 ==> |
| 558 |
|
| 559 |
---------------- |
| 560 |
##16 <== Total $ 2961.60 |
| 561 |
##11 ==> Total $ 1088.35 |
| 562 |
|
| 563 |
##16 #:3 <== 2961.60 |
| 564 |
##11 #:3 ==> 1088.35 |
| 565 |
@ Absolute error = 1.8732500000e+3, Relative error = 1.7211834428e+0 |
| 566 |
|
| 567 |
+++ File "bill1" differs from file "bill2" |
| 568 |
|
| 569 |
</pre></div> |
| 570 |
<p>Looking at the displayed report we see that: |
| 571 |
</p><ul> |
| 572 |
<li> the second line of file <samp>bill1</samp>, i.e. |
| 573 |
the one containing the separator, has no |
| 574 |
correspondance, or, if you prefer, has been deleted |
| 575 |
from file <samp>bill2</samp>. |
| 576 |
</li><li> The lines related to the months January |
| 577 |
and March 2009 have been slightly modified in |
| 578 |
<samp>bill2</samp>, namely the values of the expenses |
| 579 |
are slightly different. Notice that the line |
| 580 |
with the expenses for January 2009 is the third one |
| 581 |
in file <samp>bill1</samp> and the second one in file |
| 582 |
<samp>bill2</samp>. This information |
| 583 |
is printed by Numdiff in the form |
| 584 |
<div class="example"> |
| 585 |
<pre class="example">##3 <== Jan09 $ 233.56 |
| 586 |
##2 ==> Jan09 $ 234.00 |
| 587 |
</pre></div> |
| 588 |
<p>Analogously, |
| 589 |
</p><div class="example"> |
| 590 |
<pre class="example">##5 <== Mar09 $ 12.55 |
| 591 |
##3 ==> Mar09 $ 13.00 |
| 592 |
</pre></div> |
| 593 |
<p>says that the line for March is |
| 594 |
the fifth one in <samp>bill1</samp> and the third |
| 595 |
one in <samp>bill2</samp>. |
| 596 |
</p></li><li> The line related to |
| 597 |
the total amount of the expenses |
| 598 |
appears also differently in the two files, |
| 599 |
since the amount of the expenses is different. |
| 600 |
Notice that this line is the 16th one |
| 601 |
in file <samp>bill1</samp> and the 11th one in file |
| 602 |
<samp>bill2</samp>. |
| 603 |
</li><li> The lines related to the months February, |
| 604 |
April, June, August and October, i.e. the lines |
| 605 |
no. 4, 6, 8, 10, and 12 of <samp>bill1</samp>, are not present |
| 606 |
in <samp>bill2</samp>. |
| 607 |
</li><li> The line of <samp>bill1</samp> with the expenses for December 2009 |
| 608 |
is replaced in <samp>bill2</samp> by the line containing |
| 609 |
the value of the expenses for January 2010. |
| 610 |
</li><li> The tenth line of <samp>bill2</samp>, i.e. the empty line |
| 611 |
after the separator, is not present in <samp>bill1</samp>. |
| 612 |
With respect to <samp>bill1</samp> this line represents then an addition. |
| 613 |
</li></ul> |
| 614 |
|
| 615 |
<p>If you compare <samp>bill1</samp> and <samp>bill2</samp> |
| 616 |
without using the option <samp>-z @</samp>, the result is completely |
| 617 |
misleading. This is the output of ‘<samp>numdiff -V bill1 bill2</samp>’: |
| 618 |
</p><div class="example"> |
| 619 |
<pre class="example"> |
| 620 |
---------------- |
| 621 |
##2 <== ------------------------- |
| 622 |
##2 ==> Jan09 $ 234.00 |
| 623 |
|
| 624 |
##2 #:1 <== ------------------------- |
| 625 |
##2 #:1 ==> Jan09 |
| 626 |
@ @@ |
| 627 |
##2 <== |
| 628 |
##2 #>2 ==> $ 234.00 |
| 629 |
@ Line 2 in file "bill1" is shorter than expected! |
| 630 |
---------------- |
| 631 |
##3 <== Jan09 $ 233.56 |
| 632 |
##3 ==> Mar09 $ 13.00 |
| 633 |
|
| 634 |
##3 #:1 <== Jan09 |
| 635 |
##3 #:1 ==> Mar09 |
| 636 |
@ @@ |
| 637 |
##3 #:3 <== 233.56 |
| 638 |
##3 #:3 ==> 13.00 |
| 639 |
@ Absolute error = 2.2056000000e+2, Relative error = 1.6966153846e+1 |
| 640 |
---------------- |
| 641 |
##4 <== Feb09 $ 850.77 |
| 642 |
##4 ==> May09 $ 78.25 |
| 643 |
|
| 644 |
##4 #:1 <== Feb09 |
| 645 |
##4 #:1 ==> May09 |
| 646 |
@ @@ |
| 647 |
##4 #:3 <== 850.77 |
| 648 |
##4 #:3 ==> 78.25 |
| 649 |
@ Absolute error = 7.7252000000e+2, Relative error = 9.8724600639e+0 |
| 650 |
---------------- |
| 651 |
##5 <== Mar09 $ 12.55 |
| 652 |
##5 ==> Jul09 $ 443.10 |
| 653 |
|
| 654 |
##5 #:1 <== Mar09 |
| 655 |
##5 #:1 ==> Jul09 |
| 656 |
@ @@ |
| 657 |
##5 #:3 <== 12.55 |
| 658 |
##5 #:3 ==> 443.10 |
| 659 |
@ Absolute error = 4.3055000000e+2, Relative error = 3.4306772908e+1 |
| 660 |
---------------- |
| 661 |
##6 <== Apr09 $ 524.00 |
| 662 |
##6 ==> Sep09 $ 10.00 |
| 663 |
|
| 664 |
##6 #:1 <== Apr09 |
| 665 |
##6 #:1 ==> Sep09 |
| 666 |
@ @@ |
| 667 |
##6 #:3 <== 524.00 |
| 668 |
##6 #:3 ==> 10.00 |
| 669 |
@ Absolute error = 5.1400000000e+2, Relative error = 5.1400000000e+1 |
| 670 |
---------------- |
| 671 |
##7 <== May09 $ 78.25 |
| 672 |
##7 ==> Nov09 $ 110.00 |
| 673 |
|
| 674 |
##7 #:1 <== May09 |
| 675 |
##7 #:1 ==> Nov09 |
| 676 |
@ @@ |
| 677 |
##7 #:3 <== 78.25 |
| 678 |
##7 #:3 ==> 110.00 |
| 679 |
@ Absolute error = 3.1750000000e+1, Relative error = 4.0575079872e-1 |
| 680 |
---------------- |
| 681 |
##8 <== Jun09 $ 230.00 |
| 682 |
##8 ==> Jan10 $ 200.00 |
| 683 |
|
| 684 |
##8 #:1 <== Jun09 |
| 685 |
##8 #:1 ==> Jan10 |
| 686 |
@ @@ |
| 687 |
##8 #:3 <== 230.00 |
| 688 |
##8 #:3 ==> 200.00 |
| 689 |
@ Absolute error = 3.0000000000e+1, Relative error = 1.5000000000e-1 |
| 690 |
---------------- |
| 691 |
##9 <== Jul09 $ 443.10 |
| 692 |
##9 ==> ------------------------- |
| 693 |
|
| 694 |
##9 #:1 <== Jul09 |
| 695 |
##9 #:1 ==> ------------------------- |
| 696 |
@ @@ |
| 697 |
##9 #>2 <== $ 443.10 |
| 698 |
##9 ==> |
| 699 |
@ Line 9 in file "bill2" is shorter than expected! |
| 700 |
---------------- |
| 701 |
##10 <== Aug09 $ 67.65 |
| 702 |
##10 ==> |
| 703 |
|
| 704 |
##10 #>1 <== Aug09 $ 67.65 |
| 705 |
##10 ==> |
| 706 |
@ Line 10 in file "bill2" is shorter than expected! |
| 707 |
---------------- |
| 708 |
##11 <== Sep09 $ 10.00 |
| 709 |
##11 ==> Total $ 1088.35 |
| 710 |
|
| 711 |
##11 #:1 <== Sep09 |
| 712 |
##11 #:1 ==> Total |
| 713 |
@ @@ |
| 714 |
##11 #:3 <== 10.00 |
| 715 |
##11 #:3 ==> 1088.35 |
| 716 |
@ Absolute error = 1.0783500000e+3, Relative error = 1.0783500000e+2 |
| 717 |
---------------- |
| 718 |
##12 <== Oct09 $ 201.45 |
| 719 |
==> |
| 720 |
|
| 721 |
|
| 722 |
*** End of file "bill2" reached while trying to read line 12. |
| 723 |
File "bill1" has more lines than file "bill2", |
| 724 |
line 12 is the last one read from file "bill1" |
| 725 |
|
| 726 |
|
| 727 |
+++ File "bill1" differs from file "bill2" |
| 728 |
</pre></div> |
| 729 |
<p>Numdiff compares now the first, second, third line of <samp>bill1</samp> |
| 730 |
with the first, second, third line of <samp>bill2</samp>, and so on. |
| 731 |
But probably this is not what you want in such a case: what |
| 732 |
is reasonable here is to compare entries related to the same |
| 733 |
month and not lines having the same location, i.e. the |
| 734 |
same line number. |
| 735 |
</p> |
| 736 |
<p>Numdiff offers also an option to run just the filter |
| 737 |
and see how it resynchronizes the two given files |
| 738 |
without performing any comparison of corresponding lines. |
| 739 |
The output of ‘<samp>numdiff -z @ -f bill1 bill2</samp>’ is |
| 740 |
</p><div class="example"> |
| 741 |
<pre class="example"> Month Expenses Month Expenses |
| 742 |
------------------------- < |
| 743 |
Jan09 $ 233.56 Jan09 $ 234.00 |
| 744 |
Feb09 $ 850.77 < |
| 745 |
Mar09 $ 12.55 Mar09 $ 13.00 |
| 746 |
Apr09 $ 524.00 < |
| 747 |
May09 $ 78.25 May09 $ 78.25 |
| 748 |
Jun09 $ 230.00 < |
| 749 |
Jul09 $ 443.10 Jul09 $ 443.10 |
| 750 |
Aug09 $ 67.65 < |
| 751 |
Sep09 $ 10.00 Sep09 $ 10.00 |
| 752 |
Oct09 $ 201.45 < |
| 753 |
Nov09 $ 110.00 Nov09 $ 110.00 |
| 754 |
Dec09 $ 200.27 | Jan10 $ 200.00 |
| 755 |
------------------------- ------------------------- |
| 756 |
> |
| 757 |
Total $ 2961.60 Total $ 1088.35 |
| 758 |
|
| 759 |
|
| 760 |
+++ File "bill1" differs from file "bill2" |
| 761 |
</pre></div> |
| 762 |
|
| 763 |
<p>and shows that the filter is doing its job in the right way, |
| 764 |
associating the lines according to the month |
| 765 |
and not to the line number. |
| 766 |
Running just the filter is extremely useful in all |
| 767 |
situations when you are not sure if the filter is working as |
| 768 |
you wish. |
| 769 |
You have indeed to instruct the filter in the right way to let |
| 770 |
it work correctly, and this requires the use of different |
| 771 |
options depending on the structure of the files to compare. |
| 772 |
Since guessing the right options can be sometimes |
| 773 |
tricky, running just the filter and see the result is |
| 774 |
the best way to be certain that you are setting up |
| 775 |
everything correctly. |
| 776 |
Later, see <a href="#Filtering">Filtering</a>, I will explain in detail |
| 777 |
</p><ul> |
| 778 |
<li> what the filter |
| 779 |
does behind the scenes to understand |
| 780 |
if and how it has to resynchronize the files to compare, |
| 781 |
</li><li> and how the related options affect the action |
| 782 |
of the filter. |
| 783 |
</li></ul> |
| 784 |
|
| 785 |
<p>By the way, it is even possible to use <samp>-f</samp> |
| 786 |
without any other additional option for the filter, like |
| 787 |
in ‘<samp>numdiff -f bill1 bill2</samp>’, but the result is more or less |
| 788 |
the same you would obtain by performing a byte-by-byte comparison |
| 789 |
with removal of the field delimiters. |
| 790 |
</p> |
| 791 |
<p>The option <samp>-f</samp> can be followed by an argument in the form |
| 792 |
of an integer number whose meaning will be explained |
| 793 |
later, see <a href="#Use-of-the-option-_002df">Use of the option -f</a>. |
| 794 |
</p> |
| 795 |
<p>Even if the output of <code>numdiff</code> is supposed to be self-explanatory, |
| 796 |
in the next section I will explain in details all you should know about it. |
| 797 |
</p> |
| 798 |
<table class="menu" border="0" cellspacing="0"> |
| 799 |
<tr><td align="left" valign="top">• <a href="#Output-format" accesskey="1">Output format</a>:</td><td> </td><td align="left" valign="top">How numdiff prints its reports on stdout |
| 800 |
</td></tr> |
| 801 |
<tr><td align="left" valign="top">• <a href="#Overview-mode" accesskey="2">Overview mode</a>:</td><td> </td><td align="left" valign="top">An alternative way to print listings of differences |
| 802 |
</td></tr> |
| 803 |
<tr><td align="left" valign="top">• <a href="#Filter-output" accesskey="3">Filter output</a>:</td><td> </td><td align="left" valign="top">How the built-in filter prints its report |
| 804 |
</td></tr> |
| 805 |
<tr><td align="left" valign="top">• <a href="#Raw-output" accesskey="4">Raw output</a>:</td><td> </td><td align="left" valign="top">A compact output format suitable for automated parsing |
| 806 |
</td></tr> |
| 807 |
</table> |
| 808 |
|
| 809 |
<hr> |
| 810 |
<a name="Output-format"></a> |
| 811 |
<div class="header"> |
| 812 |
<p> |
| 813 |
Next: <a href="#Overview-mode" accesskey="n" rel="next">Overview mode</a>, Up: <a href="#Overview" accesskey="u" rel="up">Overview</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 814 |
</div> |
| 815 |
<a name="Output-format-1"></a> |
| 816 |
<h3 class="section">3.1 Output format</h3> |
| 817 |
|
| 818 |
<a name="index-Output-format-_0028numdiff_0029"></a> |
| 819 |
<a name="index-Format-of-the-reports"></a> |
| 820 |
|
| 821 |
<p>Let us go back to our first example. |
| 822 |
If the files <samp>list1</samp> and <samp>list2</samp> contain the data |
| 823 |
</p><pre class="verbatim">accident 123 23Joshua 34.55 +3+4i water |
| 824 |
dog -3455.321 cat 2.345678e-9 .0005-6.23e2i |
| 825 |
|
| 826 |
</pre> |
| 827 |
<p>and |
| 828 |
</p> |
| 829 |
<pre class="verbatim">Accident 123 23456 34.5500 +3.0001+4i |
| 830 |
dog -3455.320098 Cat +2.345678e-9 -6.23e2i $$$ |
| 831 |
A new line |
| 832 |
|
| 833 |
</pre> |
| 834 |
<p>respectively, then the output of the command ‘<samp>numdiff list1 list2</samp>’ |
| 835 |
will be: |
| 836 |
</p> |
| 837 |
<div class="example"> |
| 838 |
<pre class="example">---------------- |
| 839 |
##1 #:1 <== accident |
| 840 |
##1 #:1 ==> Accident |
| 841 |
@ @@ |
| 842 |
##1 #:3 <== 23Joshua |
| 843 |
##1 #:3 ==> 23456 |
| 844 |
@ @@ |
| 845 |
##1 #:5 <== +3+4i |
| 846 |
##1 #:5 ==> +3.0001+4i |
| 847 |
@ Absolute error = 1.0000000000e-4, Relative error = 2.0000000000e-5 |
| 848 |
##1 #>6 <== water |
| 849 |
##1 ==> |
| 850 |
@ Line 1 in file "list2" is shorter than expected! |
| 851 |
---------------- |
| 852 |
##2 #:2 <== -3455.321 |
| 853 |
##2 #:2 ==> -3455.320098 |
| 854 |
@ Absolute error = 9.0200000000e-4, Relative error = 2.6104672633e-7 |
| 855 |
##2 #:3 <== cat |
| 856 |
##2 #:3 ==> Cat |
| 857 |
@ @@ |
| 858 |
##2 #:5 <== .0005-6.23e2i |
| 859 |
##2 #:5 ==> -6.23e2i |
| 860 |
@ Absolute error = 5.0000000000e-4, Relative error = 8.0256821830e-7 |
| 861 |
##2 <== |
| 862 |
##2 #>6 ==> $$$ |
| 863 |
@ Line 2 in file "list1" is shorter than expected! |
| 864 |
---------------- |
| 865 |
##3 <== |
| 866 |
##3 #>1 ==> A new line |
| 867 |
@ Line 3 in file "list1" is shorter than expected! |
| 868 |
---------------- |
| 869 |
<== |
| 870 |
##4 ==> |
| 871 |
|
| 872 |
|
| 873 |
+++ File "list1" differs from file "list2" |
| 874 |
</pre></div> |
| 875 |
|
| 876 |
<p><code>numdiff</code> prints a report on the standard output |
| 877 |
for every field of the first file which |
| 878 |
differs from the corresponding field of the second file. |
| 879 |
</p> |
| 880 |
<p>This report indicates first the locations |
| 881 |
of the fields, namely the numbers |
| 882 |
of the lines where the fields appear and |
| 883 |
their positions within the line. The position in the line |
| 884 |
is “1” for the first field of a line, “2” |
| 885 |
for the second field, “3” for the third one, and so on: fields |
| 886 |
are numerated starting from the left hand of the line |
| 887 |
and proceeding towards the right hand. |
| 888 |
For each report the line number is introduced by the symbol “##”, |
| 889 |
while the field number by “#:”. |
| 890 |
Then <code>numdiff</code> shows in what the difference consists. |
| 891 |
For example, |
| 892 |
</p><div class="example"> |
| 893 |
<pre class="example">##1 #:1 <== accident |
| 894 |
##1 #:1 ==> Accident |
| 895 |
@ @@ |
| 896 |
</pre></div> |
| 897 |
|
| 898 |
<p>means that the first field of the first line is |
| 899 |
“accident” in the first file, while in the |
| 900 |
second file it appears as “Accident”. |
| 901 |
This difference could be then canceled |
| 902 |
by removing “accident” from the first file |
| 903 |
and inserting “Accident” in place of it. |
| 904 |
The arrows “<==” and “==>” try to |
| 905 |
visualize this idea. |
| 906 |
Analogously, |
| 907 |
</p><div class="example"> |
| 908 |
<pre class="example">##2 #:2 <== -3455.321 |
| 909 |
##2 #:2 ==> -3455.320098 |
| 910 |
@ Absolute error = 9.0200000000e-4, Relative error = 2.6104672633e-7 |
| 911 |
</pre></div> |
| 912 |
|
| 913 |
<p>means that the second field of the second line |
| 914 |
is “-3455.321” in the first file and |
| 915 |
“-3455.320098” in the second one. |
| 916 |
Since the contents of the field are numerical |
| 917 |
in both files, <code>numdiff</code> also prints |
| 918 |
the absolute and relative errors. |
| 919 |
</p> |
| 920 |
<p>The absolute error (or absolute difference) is given by the absolute |
| 921 |
value of the difference between the values |
| 922 |
appearing in the two files. |
| 923 |
</p> |
| 924 |
<p>The relative error (or relative difference) is actually defined |
| 925 |
in a more complicated way. |
| 926 |
If <em>n1</em> is the value appearing in the first |
| 927 |
file and <em>n2</em> is the value in the second file, |
| 928 |
then the absolute error is given by the formula <em>A=|n1-n2|</em>, |
| 929 |
while the relative error <em>R</em> is given by: |
| 930 |
</p> |
| 931 |
<ul> |
| 932 |
<li> <em>R = 0</em> if <em>n1</em> and <em>n2</em> are equal, |
| 933 |
</li><li> <em>Inf</em> (infinity) if <em>n2</em> differs from <em>n1</em> and |
| 934 |
at least one of them is zero, |
| 935 |
</li><li> <em>R = A/ min(|n1|, |n2|)</em> if <em>n1</em> and <em>n2</em> are |
| 936 |
both non zero and <em>n2</em> differs from <em>n1</em>. <em>min(|n1|, |n2|)</em> |
| 937 |
denotes the minimum between the absolute value of <em>n1</em> |
| 938 |
and the absolute value of <em>n2</em>. |
| 939 |
</li></ul> |
| 940 |
|
| 941 |
<p>With these definitions of absolute |
| 942 |
and relative error it turns out that <em>A(n2, n1) = A(n1, n2)</em> and |
| 943 |
<em>R(n2, n1) = R(n1, n2)</em>. In other words, the absolute/relative error |
| 944 |
does not change if you only change the order of the compared values. |
| 945 |
Since version 5 it is actually possible to let Numdiff |
| 946 |
compute the relative error always with respect to the value |
| 947 |
from the first file or always with respect to the value |
| 948 |
from the second file, instead of using the preceding formula. |
| 949 |
This can be done through the option <samp>-F</samp>, |
| 950 |
see <a href="#Alternative-formulas-for-the-computation-of-the-relative-difference">Alternative formulas for the computation of the relative difference</a>. |
| 951 |
</p> |
| 952 |
<p>If at least one of the compared fields is not numerical, then the output line |
| 953 |
reporting absolute and relative errors is replaced by |
| 954 |
the separator: |
| 955 |
</p><pre class="verbatim">@ @@ |
| 956 |
</pre> |
| 957 |
<p>It can happen that a line in one of the two files to compare contains |
| 958 |
more fields than the corresponding line of the other file. |
| 959 |
If this is the case, <code>numdiff</code> reports this difference |
| 960 |
by telling that a certain line (identified by its |
| 961 |
line number) appears to be shorter than expected, |
| 962 |
just as in |
| 963 |
</p><div class="example"> |
| 964 |
<pre class="example">##1 #>6 <== water |
| 965 |
##1 ==> |
| 966 |
@ Line 1 in file "list2" is shorter than expected! |
| 967 |
</pre></div> |
| 968 |
|
| 969 |
<p>or in |
| 970 |
</p><div class="example"> |
| 971 |
<pre class="example">##3 <== |
| 972 |
##3 #>1 ==> A new line |
| 973 |
@ Line 3 in file "list1" is shorter than expected! |
| 974 |
</pre></div> |
| 975 |
|
| 976 |
<p>In addition, <code>numdiff</code> shows |
| 977 |
the <i>tail</i> of the longer line, using the notation “#><em>n</em>” |
| 978 |
to indicate the number <em>n</em> of the first field of the longer line |
| 979 |
for which there is no corresponding field in the shorter line. |
| 980 |
For example, |
| 981 |
</p><div class="example"> |
| 982 |
<pre class="example">##1 #>6 <== water |
| 983 |
##1 ==> |
| 984 |
@ Line 1 in file "list2" is shorter than expected! |
| 985 |
</pre></div> |
| 986 |
|
| 987 |
<p>means that none of the fields of the first line starting from the sixth one |
| 988 |
has a corresponding field in the second file (<samp>list2</samp>). |
| 989 |
In this context, the symbol <tt><<*>></tt> (if it appears) is used to denote |
| 990 |
the End-Of-File, i.e. a line or the tail of a line which |
| 991 |
is located at the end of the corresponding file and |
| 992 |
does not have a terminating <em>newline</em> character. |
| 993 |
</p> |
| 994 |
<p>It can also happen that one of the two |
| 995 |
files to compare has less lines than the other one. |
| 996 |
In this case, if no special option is passed to the program, |
| 997 |
<code>numdiff</code> prints the number of the first |
| 998 |
line which appears in only one of the two files and |
| 999 |
a message on the standard error telling in which of the two files |
| 1000 |
the end has been prematurely reached: |
| 1001 |
</p><div class="example"> |
| 1002 |
<pre class="example">*** End of file "list1" reached while trying to read line 4. |
| 1003 |
File "list2" has more lines than file "list1", |
| 1004 |
line 4 is the last one read from file "list2" |
| 1005 |
</pre></div> |
| 1006 |
|
| 1007 |
<p>Unless the option <samp>-q</samp> is used (see <a href="#Invoking-numdiff">Invoking numdiff</a>), |
| 1008 |
<code>numdiff</code> prints to the standard output |
| 1009 |
a message reporting the final status of the comparison. |
| 1010 |
This message says either the two files are equal |
| 1011 |
or they are different, just as in the example we are |
| 1012 |
considering: |
| 1013 |
</p><div class="example"> |
| 1014 |
<pre class="example">+++ File "list1" differs from file "list2" |
| 1015 |
</pre></div> |
| 1016 |
|
| 1017 |
<hr> |
| 1018 |
<a name="Overview-mode"></a> |
| 1019 |
<div class="header"> |
| 1020 |
<p> |
| 1021 |
Next: <a href="#Filter-output" accesskey="n" rel="next">Filter output</a>, Previous: <a href="#Output-format" accesskey="p" rel="prev">Output format</a>, Up: <a href="#Overview" accesskey="u" rel="up">Overview</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 1022 |
</div> |
| 1023 |
<a name="Overview-mode-1"></a> |
| 1024 |
<h3 class="section">3.2 Overview mode</h3> |
| 1025 |
|
| 1026 |
<a name="index-Overview-mode-of-numdiff"></a> |
| 1027 |
<a name="index-Side_002dby_002dside-report-_0028numdiff_0029"></a> |
| 1028 |
|
| 1029 |
<p>Since version 5.6 an alternative way to display the differences |
| 1030 |
between two files is available, which can be activated |
| 1031 |
through the option <samp>-O</samp>. |
| 1032 |
If this option is present on the command line, <code>numdiff</code> |
| 1033 |
prints a side-by-side report instead of the usual one. |
| 1034 |
</p> |
| 1035 |
<p>For example, if <samp>sheet1</samp> contains the text |
| 1036 |
</p><pre class="verbatim">A 1 1 |
| 1037 |
B 2 4 |
| 1038 |
C 3 9 |
| 1039 |
D 4 16 |
| 1040 |
E 5 25 |
| 1041 |
F 6 36 |
| 1042 |
G 7 49 |
| 1043 |
H 8 64 |
| 1044 |
I 9 81 |
| 1045 |
J 10 100 |
| 1046 |
</pre> |
| 1047 |
<p>and <samp>sheet2</samp> the following lines |
| 1048 |
</p> |
| 1049 |
<pre class="verbatim">A 1 1 |
| 1050 |
B 2 4 |
| 1051 |
C 3.3 9.03 |
| 1052 |
D 4 16 |
| 1053 |
E 5.5 25.05 |
| 1054 |
F 6.6 36 |
| 1055 |
G 7.7 49.49 |
| 1056 |
H 8 64 |
| 1057 |
I 9.9 81.09 |
| 1058 |
</pre> |
| 1059 |
<p>then ‘<samp>numdiff -O sheet1 sheet2</samp>’ prints this report |
| 1060 |
</p><div class="example"> |
| 1061 |
<pre class="example">A 1 1 A 1 1 |
| 1062 |
B 2 4 B 2 4 |
| 1063 |
C 3 9 :!:C 3.3 9.03 |
| 1064 |
D 4 16 D 4 16 |
| 1065 |
E 5 25 :!:E 5.5 25.05 |
| 1066 |
F 6 36 :!:F 6.6 36 |
| 1067 |
G 7 49 :!:G 7.7 49.49 |
| 1068 |
H 8 64 H 8 64 |
| 1069 |
I 9 81 :!:I 9.9 81.09 |
| 1070 |
J 10 100 :<: |
| 1071 |
|
| 1072 |
*** End of file "sheet2" reached while trying to read line 10. |
| 1073 |
File "sheet1" has more lines than file "sheet2", |
| 1074 |
line 10 is the last one read from file "sheet1" |
| 1075 |
|
| 1076 |
|
| 1077 |
+++ File "sheet1" differs from file "sheet2" |
| 1078 |
</pre></div> |
| 1079 |
|
| 1080 |
<p>On the left side you can see the lines coming from the file |
| 1081 |
specified as first on the command line, i.e. <samp>sheet1</samp>, |
| 1082 |
on the right side the lines from the second file of the command line, |
| 1083 |
in this case <samp>sheet2</samp>. In the middle there is a <i>gutter</i> |
| 1084 |
which contains one of these markers: |
| 1085 |
</p><dl compact="compact"> |
| 1086 |
<dt>‘<samp>white spaces</samp>’</dt> |
| 1087 |
<dd><p>The corresponding lines are in common. That is, either the lines |
| 1088 |
are identical, or the difference is ignored because of one of the |
| 1089 |
options <samp>-s</samp>, <samp>-D</samp>, <samp>-I</samp>, <samp>-X</samp>, <samp>-a</samp>, |
| 1090 |
<samp>-r</samp>, <samp>-P</samp>, or <samp>-N</samp>. |
| 1091 |
</p> |
| 1092 |
</dd> |
| 1093 |
<dt>‘<samp>:!:</samp>’</dt> |
| 1094 |
<dd><p>The corresponding lines have at least one field which differs. |
| 1095 |
</p> |
| 1096 |
</dd> |
| 1097 |
<dt>‘<samp>:<:</samp>’</dt> |
| 1098 |
<dd><p>The files differ and only the first file contains the line. |
| 1099 |
</p> |
| 1100 |
</dd> |
| 1101 |
<dt>‘<samp>:>:</samp>’</dt> |
| 1102 |
<dd><p>The files differ and only the second file contains the line. |
| 1103 |
</p></dd> |
| 1104 |
</dl> |
| 1105 |
|
| 1106 |
<p>In the case of <samp>sheet1</samp> and <samp>sheet2</samp> a message |
| 1107 |
is printed after the report saying that the end of the second file |
| 1108 |
has been prematurely reached. The two files do not have indeed |
| 1109 |
the same number of lines and the filter has not been activated. |
| 1110 |
</p> |
| 1111 |
<p>The option <samp>-O</samp> can take an optional argument, which |
| 1112 |
allows to set the width of the output and eventually to suppress |
| 1113 |
common lines, see <a href="#Invoking-numdiff">Invoking numdiff</a>. |
| 1114 |
The default value for the width of the side-by-side report |
| 1115 |
is 130. No wonder then that the command ‘<samp>numdiff -O40 sheet1 sheet2</samp>’ |
| 1116 |
displays a report with shorter lines: |
| 1117 |
</p><div class="example"> |
| 1118 |
<pre class="example">A 1 1 A 1 1 |
| 1119 |
B 2 4 B 2 4 |
| 1120 |
C 3 9 :!: C 3.3 9.03 |
| 1121 |
D 4 16 D 4 16 |
| 1122 |
E 5 25 :!: E 5.5 25.05 |
| 1123 |
F 6 36 :!: F 6.6 36 |
| 1124 |
G 7 49 :!: G 7.7 49.49 |
| 1125 |
H 8 64 H 8 64 |
| 1126 |
I 9 81 :!: I 9.9 81.09 |
| 1127 |
J 10 100 :<: |
| 1128 |
|
| 1129 |
*** End of file "sheet2" reached while trying to read line 10. |
| 1130 |
File "sheet1" has more lines than file "sheet2", |
| 1131 |
line 10 is the last one read from file "sheet1" |
| 1132 |
|
| 1133 |
|
| 1134 |
+++ File "sheet1" differs from file "sheet2" |
| 1135 |
</pre></div> |
| 1136 |
|
| 1137 |
<p>A negative argument makes that only the differences are listed in |
| 1138 |
the side-by-side report, as shown by |
| 1139 |
the output of the command ‘<samp>numdiff -O40 sheet1 sheet2</samp>’: |
| 1140 |
</p><div class="example"> |
| 1141 |
<pre class="example">C 3 9 :!: C 3.3 9.03 |
| 1142 |
E 5 25 :!: E 5.5 25.05 |
| 1143 |
F 6 36 :!: F 6.6 36 |
| 1144 |
G 7 49 :!: G 7.7 49.49 |
| 1145 |
I 9 81 :!: I 9.9 81.09 |
| 1146 |
J 10 100 :<: |
| 1147 |
|
| 1148 |
*** End of file "sheet2" reached while trying to read line 10. |
| 1149 |
File "sheet1" has more lines than file "sheet2", |
| 1150 |
line 10 is the last one read from file "sheet1" |
| 1151 |
|
| 1152 |
|
| 1153 |
+++ File "sheet1" differs from file "sheet2" |
| 1154 |
</pre></div> |
| 1155 |
|
| 1156 |
<p>If you set the width of the report to a too small value, it can happen |
| 1157 |
that some or even all lines from the compared files appear truncated as |
| 1158 |
in the output of ‘<samp>numdiff -O24 sheet1 sheet2</samp>’: |
| 1159 |
</p><div class="example"> |
| 1160 |
<pre class="example">A 1 A 1 |
| 1161 |
B 2 B 2 |
| 1162 |
C 3 :!: C 3.3 |
| 1163 |
D 4 D 4 |
| 1164 |
E 5 :!: E 5.5 |
| 1165 |
F 6 :!: F 6.6 |
| 1166 |
G 7 :!: G 7.7 |
| 1167 |
H 8 H 8 |
| 1168 |
I 9 :!: I 9.9 |
| 1169 |
J 10 :<: |
| 1170 |
|
| 1171 |
*** End of file "sheet2" reached while trying to read line 10. |
| 1172 |
File "sheet1" has more lines than file "sheet2", |
| 1173 |
line 10 is the last one read from file "sheet1" |
| 1174 |
|
| 1175 |
|
| 1176 |
+++ File "sheet1" differs from file "sheet2" |
| 1177 |
</pre></div> |
| 1178 |
|
| 1179 |
<p>If you set the width of the report to a very small value, Numdiff |
| 1180 |
ignores it and uses the default value, i.e. 130. |
| 1181 |
</p> |
| 1182 |
<p>Notice that the numeric argument must immediately follow the option <samp>-O</samp>, |
| 1183 |
intermediate spaces are not allowed. This |
| 1184 |
is also the case for the optional argument of <samp>-f</samp>, while |
| 1185 |
the options of Numdiff which require a mandatory argument permit |
| 1186 |
the presence of intermediate spaces between them and the argument. |
| 1187 |
</p> |
| 1188 |
<p>The option <samp>-O</samp> can be used together with any other option of |
| 1189 |
Numdiff except for <samp>-f</samp>, <samp>-q</samp>, <samp>-U</samp>, <samp>-E</samp>, |
| 1190 |
<samp>-V</samp> and <samp>-b</samp>. When <samp>-O</samp> is in use, <samp>-U</samp>, |
| 1191 |
<samp>-E</samp>, <samp>-V</samp> and <samp>-b</samp> are ignored. If <samp>-q</samp> |
| 1192 |
is present on the command line together with <samp>-O</samp>, then |
| 1193 |
<samp>-O</samp> is ignored. Finally, if both <samp>-f</samp> and <samp>-O</samp> |
| 1194 |
are present, then the behavior depends on the order: the option which |
| 1195 |
appears first on the command line is the one which matters. |
| 1196 |
</p> |
| 1197 |
<p>Therefore, the command ‘<samp>numdiff -O40 -f sheet1 sheet2</samp>’ |
| 1198 |
displays the same report as ‘<samp>numdiff -O40 sheet1 sheet2</samp>’, |
| 1199 |
while the output of ‘<samp>numdiff -f -O40 sheet1 sheet2</samp>’ is |
| 1200 |
given by |
| 1201 |
</p><div class="example"> |
| 1202 |
<pre class="example">A 1 1 A 1 1 |
| 1203 |
B 2 4 B 2 4 |
| 1204 |
C 3 9 | C 3.3 9.03 |
| 1205 |
D 4 16 D 4 16 |
| 1206 |
E 5 25 | E 5.5 25.05 |
| 1207 |
F 6 36 | F 6.6 36 |
| 1208 |
G 7 49 | G 7.7 49.49 |
| 1209 |
H 8 64 H 8 64 |
| 1210 |
I 9 81 | I 9.9 81.09 |
| 1211 |
J 10 100 < |
| 1212 |
|
| 1213 |
|
| 1214 |
+++ File "sheet1" differs from file "sheet2" |
| 1215 |
</pre></div> |
| 1216 |
|
| 1217 |
<p>and coincides then with the output of ‘<samp>numdiff -f sheet1 sheet2</samp>’. |
| 1218 |
</p> |
| 1219 |
<p>The option <samp>-O</samp> can be used together with the filter to cope |
| 1220 |
with the addition/deletion of lines. |
| 1221 |
If the file <samp>sheet3</samp> contains the text |
| 1222 |
</p><pre class="verbatim">A 1 1 |
| 1223 |
C 3.3 9.03 |
| 1224 |
E 5.5 25.05 |
| 1225 |
G 7.7 49.49 |
| 1226 |
I 9.9 81.09 |
| 1227 |
J 10 100.00 |
| 1228 |
K 0 0.02 |
| 1229 |
</pre> |
| 1230 |
<p>then ‘<samp>numdiff -O40 sheet1 sheet3</samp>’ prints a wrong report, |
| 1231 |
as in the example with files <samp>bill1</samp> and <samp>bill2</samp>: |
| 1232 |
</p><div class="example"> |
| 1233 |
<pre class="example">A 1 1 A 1 1 |
| 1234 |
B 2 4 :!: C 3.3 9.03 |
| 1235 |
C 3 9 :!: E 5.5 25.05 |
| 1236 |
D 4 16 :!: G 7.7 49.49 |
| 1237 |
E 5 25 :!: I 9.9 81.09 |
| 1238 |
F 6 36 :!: J 10 100.00 |
| 1239 |
G 7 49 :!: K 0 0.02 |
| 1240 |
H 8 64 :<: |
| 1241 |
|
| 1242 |
*** End of file "sheet3" reached while trying to read line 8. |
| 1243 |
File "sheet1" has more lines than file "sheet3", |
| 1244 |
line 8 is the last one read from file "sheet1" |
| 1245 |
|
| 1246 |
|
| 1247 |
+++ File "sheet1" differs from file "sheet3" |
| 1248 |
</pre></div> |
| 1249 |
|
| 1250 |
<p>On the other hand, the presence of <samp>-z @</samp> makes Numdiff |
| 1251 |
always compare fields of corresponding lines, as shown by |
| 1252 |
the output of the command ‘<samp>numdiff -O40 -z @ sheet1 sheet3</samp>’: |
| 1253 |
</p><div class="example"> |
| 1254 |
<pre class="example">A 1 1 A 1 1 |
| 1255 |
B 2 4 :<: |
| 1256 |
C 3 9 :!: C 3.3 9.03 |
| 1257 |
D 4 16 :<: |
| 1258 |
E 5 25 :!: E 5.5 25.05 |
| 1259 |
F 6 36 :<: |
| 1260 |
G 7 49 :!: G 7.7 49.49 |
| 1261 |
H 8 64 :<: |
| 1262 |
I 9 81 :!: I 9.9 81.09 |
| 1263 |
J 10 100 J 10 100.00 |
| 1264 |
:>: K 0 0.02 |
| 1265 |
|
| 1266 |
+++ File "sheet1" differs from file "sheet3" |
| 1267 |
</pre></div> |
| 1268 |
|
| 1269 |
<p>Side-by-side format is easy to read, but it has limitations. |
| 1270 |
It generates much wider output than usual, and truncates |
| 1271 |
lines that are too long to fit. Also, it relies on lining up output |
| 1272 |
quite heavily, so its output looks particularly bad if you |
| 1273 |
use varying width fonts, nonstandard tab stops, or nonprinting |
| 1274 |
characters. |
| 1275 |
</p> |
| 1276 |
<hr> |
| 1277 |
<a name="Filter-output"></a> |
| 1278 |
<div class="header"> |
| 1279 |
<p> |
| 1280 |
Next: <a href="#Raw-output" accesskey="n" rel="next">Raw output</a>, Previous: <a href="#Overview-mode" accesskey="p" rel="prev">Overview mode</a>, Up: <a href="#Overview" accesskey="u" rel="up">Overview</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 1281 |
</div> |
| 1282 |
<a name="Output-of-the-filter"></a> |
| 1283 |
<h3 class="section">3.3 Output of the filter</h3> |
| 1284 |
|
| 1285 |
<a name="index-Filter-output-_0028numdiff_0029"></a> |
| 1286 |
|
| 1287 |
<p>The output produced just by running the filter (option <samp>-f</samp>) is |
| 1288 |
a side-by-side difference listing of the compared files |
| 1289 |
like the one displayed by GNU sdiff. |
| 1290 |
The files are listed in two columns with a gutter between them. The |
| 1291 |
gutter contains one of the following markers: |
| 1292 |
</p><dl compact="compact"> |
| 1293 |
<dt>‘<samp>white space</samp>’</dt> |
| 1294 |
<dd><p>The corresponding lines are in common. That is, either the lines |
| 1295 |
are identical, or the difference is ignored because of one of the |
| 1296 |
options <samp>-s</samp>, <samp>-D</samp>, <samp>-I</samp>, <samp>-X</samp>, |
| 1297 |
<samp>-z</samp>, or <samp>-Z</samp>. |
| 1298 |
</p> |
| 1299 |
</dd> |
| 1300 |
<dt>‘<samp>|</samp>’</dt> |
| 1301 |
<dd><p>The corresponding lines differ, and they are either both complete |
| 1302 |
or both incomplete. |
| 1303 |
</p> |
| 1304 |
</dd> |
| 1305 |
<dt>‘<samp><</samp>’</dt> |
| 1306 |
<dt>‘<samp>(</samp>’</dt> |
| 1307 |
<dd><p>The files differ and only the first file contains the line. |
| 1308 |
</p> |
| 1309 |
</dd> |
| 1310 |
<dt>‘<samp>></samp>’</dt> |
| 1311 |
<dt>‘<samp>)</samp>’</dt> |
| 1312 |
<dd><p>The files differ and only the second file contains the line. |
| 1313 |
</p> |
| 1314 |
</dd> |
| 1315 |
<dt>‘<samp>\</samp>’</dt> |
| 1316 |
<dd><p>The corresponding lines differ, and only the first line is |
| 1317 |
incomplete. |
| 1318 |
</p> |
| 1319 |
</dd> |
| 1320 |
<dt>‘<samp>/</samp>’</dt> |
| 1321 |
<dd><p>The corresponding lines differ, and only the second line is |
| 1322 |
incomplete. |
| 1323 |
</p></dd> |
| 1324 |
</dl> |
| 1325 |
|
| 1326 |
<p>An input line is incomplete if its last character is not a newline. |
| 1327 |
This can happen only if the line is the last one of its file. |
| 1328 |
When an output line of the side by side difference listing |
| 1329 |
represents two differing lines, one might be incomplete |
| 1330 |
while the other is not. In this case the gutter is marked |
| 1331 |
‘<samp>\</samp>’ if the line from the first file is incomplete, ‘<samp>/</samp>’ |
| 1332 |
if the line from the second file is it. |
| 1333 |
</p> |
| 1334 |
<p>Like <samp>-O</samp>, the option <samp>-f</samp> can take an optional argument which |
| 1335 |
allows to set the width of the output and eventually to suppress |
| 1336 |
common lines, see <a href="#Invoking-numdiff">Invoking numdiff</a> and <a href="#Use-of-the-option-_002df">Use of the option -f</a>. |
| 1337 |
</p> |
| 1338 |
<p>More generally, the user can always make <code>numdiff</code> |
| 1339 |
avoid to print, partially or totally, the messages |
| 1340 |
that it would otherwise send to standard output. |
| 1341 |
This can be achieved by some suitable command |
| 1342 |
line options, see <a href="#Invoking-numdiff">Invoking numdiff</a>. |
| 1343 |
</p> |
| 1344 |
<hr> |
| 1345 |
<a name="Raw-output"></a> |
| 1346 |
<div class="header"> |
| 1347 |
<p> |
| 1348 |
Previous: <a href="#Filter-output" accesskey="p" rel="prev">Filter output</a>, Up: <a href="#Overview" accesskey="u" rel="up">Overview</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 1349 |
</div> |
| 1350 |
<a name="Raw-output-1"></a> |
| 1351 |
<h3 class="section">3.4 Raw output</h3> |
| 1352 |
|
| 1353 |
<a name="index-Raw-output-format"></a> |
| 1354 |
|
| 1355 |
<p>Since version 5.9 Numdiff can report the results of the |
| 1356 |
comparison of two files in a particularly compact format, |
| 1357 |
which can be easily parsed by other programs. |
| 1358 |
This <em>raw</em> format is chosen by Numdiff whenever |
| 1359 |
the user requests it through the command line option <samp>--raw</samp>. |
| 1360 |
Below you can see an example of raw output in the case |
| 1361 |
of the comparison of the files <samp>list1</samp> and <samp>list2</samp> |
| 1362 |
from section <a href="#Output-format">Output format</a>: |
| 1363 |
</p><div class="example"> |
| 1364 |
<pre class="example">1:1:1:1:*:*:accident ==> Accident |
| 1365 |
1:1:3:3:*:*:23Joshua ==> 23456 |
| 1366 |
1:1:5:5:1.0000000000e-4:2.0000000000e-5:+3+4i ==> +3.0001+4i |
| 1367 |
1:1:6:*:water |
| 1368 |
2:2:2:2:9.0200000000e-4:2.6104672633e-7:-3455.321 ==> -3455.320098 |
| 1369 |
2:2:3:3:*:*:cat ==> Cat |
| 1370 |
2:2:5:5:5.0000000000e-4:8.0256821830e-7:.0005-6.23e2i ==> -6.23e2i |
| 1371 |
2:2:*:6:$$$ |
| 1372 |
3:3:*:1:A new line |
| 1373 |
*:4 |
| 1374 |
|
| 1375 |
+++ File "list1" differs from file "list2" |
| 1376 |
</pre></div> |
| 1377 |
|
| 1378 |
<p>The raw format is not at all convenient for humans. |
| 1379 |
It has been provided only for being used by the forthcoming |
| 1380 |
graphic user interface of Numdiff (yes, Numdiff will have |
| 1381 |
a GUI sometime in the future!). |
| 1382 |
</p> |
| 1383 |
<hr> |
| 1384 |
<a name="Installing"></a> |
| 1385 |
<div class="header"> |
| 1386 |
<p> |
| 1387 |
Next: <a href="#Invoking-numdiff" accesskey="n" rel="next">Invoking numdiff</a>, Previous: <a href="#Overview" accesskey="p" rel="prev">Overview</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 1388 |
</div> |
| 1389 |
<a name="Installing-1"></a> |
| 1390 |
<h2 class="chapter">4 Installing</h2> |
| 1391 |
|
| 1392 |
<a name="index-Install"></a> |
| 1393 |
<a name="index-Compile"></a> |
| 1394 |
<a name="index-Build"></a> |
| 1395 |
|
| 1396 |
<p>To successfully compile, build and install Numdiff some |
| 1397 |
tools are required. The first one is an ANSI C compiler. |
| 1398 |
This compiler should at least accept |
| 1399 |
the option <samp>-o</samp> to write its output to a specified file, |
| 1400 |
the option <samp>-D</samp> for macros predefinition, |
| 1401 |
the option <samp>-l</samp> to search for a specified library, |
| 1402 |
and the options <samp>-I</samp> and <samp>-L</samp> |
| 1403 |
to add a given directory to the search path for include and |
| 1404 |
library files respectively. |
| 1405 |
</p> |
| 1406 |
<p>In addition, you need a POSIX implementation of the <code>make</code> utility |
| 1407 |
(I used both GNU make and smake by Joerg Schilling |
| 1408 |
to compile Numdiff) and a POSIX implementation |
| 1409 |
of the commands <code>rm</code> and <code>find</code>. |
| 1410 |
At last, you need a proper installation of GNU Texinfo |
| 1411 |
(in order to install the info documentation) and |
| 1412 |
a shell sh-compatible. |
| 1413 |
</p> |
| 1414 |
<p>Numdiff has been successfully compiled and tested on: |
| 1415 |
</p> |
| 1416 |
<ul> |
| 1417 |
<li> Slackware® GNU/Linux 10.2 with the version 3.3.6 of the GNU C Compiler (GCC), |
| 1418 |
</li><li> Slackware GNU/Linux 11 with GCC 3.4.6, |
| 1419 |
</li><li> Slackware GNU/Linux 12.2 with GCC 4.2.4, |
| 1420 |
</li><li> Slackware GNU/Linux 13 with GCC 4.3.3, |
| 1421 |
</li><li> Debian® GNU/Linux 4.0 with GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21), |
| 1422 |
</li><li> Debian GNU/Linux 6.0.3 with GCC 4.4.5 (Debian 4.4.5-8), |
| 1423 |
</li><li> Debian GNU/Linux 7.1 with GCC 4.7.2 (Debian 4.7.2-5), |
| 1424 |
</li><li> Debian GNU/Linux 8.6 with GCC 4.9.2 (Debian 4.9.2-10), |
| 1425 |
</li><li> SunOS® 5.8 with GCC 2.95.3, and |
| 1426 |
</li><li> SunOS 5.10 (i386) with the version 5.9 of the Sun C compiler. |
| 1427 |
</li></ul> |
| 1428 |
|
| 1429 |
<p>Configuration, building and installation of Numdiff can be |
| 1430 |
performed through the standard three steps: |
| 1431 |
</p><div class="example"> |
| 1432 |
<pre class="example"> ./configure |
| 1433 |
make |
| 1434 |
make install |
| 1435 |
</pre></div> |
| 1436 |
|
| 1437 |
<p>If you leave enabled the Natural Language Support and you |
| 1438 |
also want to install the localization files (at the moment |
| 1439 |
only the Italian localization is supplied), then after |
| 1440 |
‘<samp>make</samp>’ you will have to type and run |
| 1441 |
</p><div class="example"> |
| 1442 |
<pre class="example"> make install-nls |
| 1443 |
</pre></div> |
| 1444 |
|
| 1445 |
<p>By default, ‘<samp>make install</samp>’ will install all the files in |
| 1446 |
<samp>/usr/local/bin</samp>, <samp>/usr/local/info</samp> etc. You can specify |
| 1447 |
an installation prefix other than <samp>/usr/local</samp> using the |
| 1448 |
option <samp>--prefix</samp> in the <code>configure</code> step, |
| 1449 |
for instance ‘<samp>--prefix=$HOME</samp>’: |
| 1450 |
</p><div class="example"> |
| 1451 |
<pre class="example"> ./configure --prefix=$HOME |
| 1452 |
</pre></div> |
| 1453 |
|
| 1454 |
<p>For better control, you can use the options |
| 1455 |
<samp>--bindir</samp>, <samp>--infodir</samp>, and so on. |
| 1456 |
Type ‘<samp>./configure --help</samp>’ to obtain |
| 1457 |
the complete list of all available options. |
| 1458 |
</p> |
| 1459 |
<p>The documentation files (including a full User Manual |
| 1460 |
available in HTML, PDF and plain ASCII text format) |
| 1461 |
will always be put in <samp><var>DOCDIR</var>/numdiff</samp>, |
| 1462 |
where <var>DOCDIR</var> is the path specified by the option <samp>--docdir</samp> |
| 1463 |
or, if this option has not been given to |
| 1464 |
<code>configure</code>, <samp><var>PREFIX</var>/local/doc</samp>. |
| 1465 |
Here <var>PREFIX</var> is the installation prefix specified by the |
| 1466 |
option <samp>--prefix</samp> or the default <samp>/usr/local</samp>. |
| 1467 |
</p> |
| 1468 |
<p>Once Numdiff has been installed you can remove all files |
| 1469 |
related to Numdiff by a simple ‘<samp>make uninstall</samp>’. |
| 1470 |
If you have also installed the localization files trough |
| 1471 |
‘<samp>make install-nls</samp>’, use ‘<samp>make uninstall-nls</samp>’ in place |
| 1472 |
of ‘<samp>make uninstall</samp>’ to remove them too. |
| 1473 |
</p> |
| 1474 |
<p>Between the options accepted by <code>configure</code> |
| 1475 |
there are <samp>--enable-debug</samp>, <samp>--enable-optimization</samp>, |
| 1476 |
<samp>--enable-nls</samp> and <samp>--enable-gmp</samp>. |
| 1477 |
</p> |
| 1478 |
<p>The option <samp>--enable-debug</samp> turns on debugging when |
| 1479 |
compiling the source code. This is obtained by passing to the |
| 1480 |
compiler the <samp>-g</samp> option, but you can change this default |
| 1481 |
debugging flag (which could not even be recognized by your compiler) |
| 1482 |
by setting the environment variable <code>DBGFLAGS</code> before |
| 1483 |
launching <code>configure</code>. |
| 1484 |
</p> |
| 1485 |
<p>The option <samp>--enable-optimization</samp> turns on basic optimization when |
| 1486 |
compiling the source code. This is obtained by passing to the |
| 1487 |
compiler the <samp>-O</samp> option, but you can change this default |
| 1488 |
flag (which could not even be recognized by your compiler) |
| 1489 |
by setting the environment variable <code>OPTFLAGS</code> before |
| 1490 |
launching <code>configure</code>. |
| 1491 |
</p> |
| 1492 |
<p>The option <samp>--enable-nls</samp> turns on Natural Language Support. |
| 1493 |
You do not need to use it explicitly since Natural |
| 1494 |
Language Support is enabled by default. |
| 1495 |
To disable it, use <samp>--disable-nls</samp>. |
| 1496 |
Disabling Natural Language Support is suggested whenever |
| 1497 |
you want to install Numdiff on a system where the GNU gettext library |
| 1498 |
is not present. In this case |
| 1499 |
the installation of Numdiff can be accomplished, for example, through |
| 1500 |
</p><div class="example"> |
| 1501 |
<pre class="example"> ./configure --disable-nls |
| 1502 |
make |
| 1503 |
make install |
| 1504 |
</pre></div> |
| 1505 |
|
| 1506 |
<p>Since version 5.2.0 Numdiff uses to perform all computations |
| 1507 |
the GNU Multiple Precision Arithmetic Library |
| 1508 |
(also called GNU MP or GMP), if this library is available |
| 1509 |
at build-time. |
| 1510 |
The old internal support for multiple precision arithmetic |
| 1511 |
is a fall-back in case GNU MP is absent. |
| 1512 |
However, it is possible to use the internal support for |
| 1513 |
multiple precision arithmetic even if GNU MP is available: |
| 1514 |
it is sufficient to pass the option <samp>--enable-gmp=no</samp> |
| 1515 |
or <samp>--disable-gmp</samp> to the configure script |
| 1516 |
before building the program, like in |
| 1517 |
</p><div class="example"> |
| 1518 |
<pre class="example"> ./configure --disable-gmp |
| 1519 |
make |
| 1520 |
make install |
| 1521 |
</pre></div> |
| 1522 |
|
| 1523 |
<p>Enabling the old internal support for multiple precision arithmetic |
| 1524 |
is deprecated, see <a href="#with-GNU-MP-is-better">with GNU MP is better</a>. |
| 1525 |
The latest version of GNU MP is available at |
| 1526 |
<a href="http://ftp.gnu.org/gnu/gmp/">http://ftp.gnu.org/gnu/gmp/</a>. See the GNU MP web page |
| 1527 |
at <a href="http://gmplib.org/">http://gmplib.org/</a> for up-to-date information on GNU MP. |
| 1528 |
</p> |
| 1529 |
<hr> |
| 1530 |
<a name="Invoking-numdiff"></a> |
| 1531 |
<div class="header"> |
| 1532 |
<p> |
| 1533 |
Next: <a href="#ndselect" accesskey="n" rel="next">ndselect</a>, Previous: <a href="#Installing" accesskey="p" rel="prev">Installing</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 1534 |
</div> |
| 1535 |
<a name="Invoking-numdiff-1"></a> |
| 1536 |
<h2 class="chapter">5 Invoking numdiff</h2> |
| 1537 |
|
| 1538 |
<a name="index-Invoking-numdiff"></a> |
| 1539 |
<a name="index-Options_002c-command-line-_0028numdiff_0029"></a> |
| 1540 |
<a name="index-Command-line-options-for-numdiff"></a> |
| 1541 |
<a name="index-Synopsis-_0028numdiff_0029"></a> |
| 1542 |
<a name="index-Diagnostics-_0028numdiff_0029"></a> |
| 1543 |
<a name="index-Predefined-settings-of-numdiff"></a> |
| 1544 |
|
| 1545 |
<p><strong>SYNOPSIS</strong> |
| 1546 |
</p> |
| 1547 |
<div class="example"> |
| 1548 |
<pre class="example"> numdiff -h|--help|-v|--version |
| 1549 |
</pre></div> |
| 1550 |
<p>or |
| 1551 |
</p><div class="example"> |
| 1552 |
<pre class="example"> numdiff [-s <var>IFS</var>][-D <var>DELIMS</var>][-a <var>THRVAL</var>[:<var>RANGE</var>|:<var>RANGE1</var>:<var>RANGE2</var>]] |
| 1553 |
[-r <var>THRVAL</var>[:<var>RANGE</var>|:<var>RANGE1</var>:<var>RANGE2</var>]][-2][-F <var>NUM</var>][-# <var>NUM</var>][-P][-N][-I] |
| 1554 |
[-c <var>CURRNAME</var>][-d <var>C1C2</var>][-t <var>C1C2</var>][-g <var>N1N2</var>][-p <var>C1C2</var>][-n <var>C1C2</var>][-e <var>C1C2</var>] |
| 1555 |
[-i <var>C1C2</var>][-X 1:<var>RANGE</var>][-X 2:<var>RANGE</var>][-E][-U][-b][-V][-O[<var>NUM</var>]][--raw][-q][-S] |
| 1556 |
[-z 1:<var>RANGE</var>][-z 2:<var>RANGE</var>][-Z 1:<var>RANGE</var>][-Z 2:<var>RANGE</var>][-m][-H][-f[<var>NUM</var>]] |
| 1557 |
[-T][-B][-l <var>PATH</var>][-o <var>PATH</var>] <var>FILE1</var> <var>FILE2</var> |
| 1558 |
</pre></div> |
| 1559 |
|
| 1560 |
<p>where <var>FILE1</var> and <var>FILE2</var> are the names of the two files to compare |
| 1561 |
and <var>RANGE</var>, <var>RANGE1</var> and <var>RANGE2</var> stay for a positive integer |
| 1562 |
value or for a range of integer values, like ‘<samp>1-</samp>’, ‘<samp>3-5</samp>’ or ‘<samp>-7</samp>’. |
| 1563 |
</p> |
| 1564 |
<p>In the first case <code>numdiff</code> prints a short help |
| 1565 |
(not so short actually :)) or/and version number, Copyright, License notice, |
| 1566 |
NO-Warranty disclaimer, and some information about the way it was built. |
| 1567 |
In the second case <code>numdiff</code> compares the files specified by |
| 1568 |
the two mandatory arguments which follow the list of the options. |
| 1569 |
The complete paths of the files should be given, |
| 1570 |
a directory name is not accepted. |
| 1571 |
In addition, the two arguments cannot refer to the same file |
| 1572 |
but one of them can be <tt>-</tt>, which refers to stdin. |
| 1573 |
</p> |
| 1574 |
<p><strong>OPTIONS</strong> |
| 1575 |
</p> |
| 1576 |
<dl compact="compact"> |
| 1577 |
<dt><samp>-s, --separators=<var>IFS</var></samp></dt> |
| 1578 |
<dd><p>Specify the set of characters to use as delimiters |
| 1579 |
while splitting the input lines into fields |
| 1580 |
(The default set of delimiters is space, tab and newline). |
| 1581 |
If <var>IFS</var> is prefixed with ‘<samp>1:</samp>’ or ‘<samp>2:</samp>’, use the given delimiter set |
| 1582 |
only for the lines from the first or the second file respectively |
| 1583 |
</p> |
| 1584 |
</dd> |
| 1585 |
<dt><samp>-D, --delimiters=<var>DELIMS</var></samp></dt> |
| 1586 |
<dd><p>Specify the set of strings to use as delimiters |
| 1587 |
while splitting the input lines into fields |
| 1588 |
(The default set of delimiters is space, tab and newline). |
| 1589 |
If <var>DELIMS</var> is prefixed with ‘<samp>1:</samp>’ or ‘<samp>2:</samp>’, use the given delimiter set |
| 1590 |
only for the lines from the first or the second file respectively |
| 1591 |
</p> |
| 1592 |
</dd> |
| 1593 |
<dt><samp>-a, --absolute-tolerance=<var>THRVAL</var>[:<var>RANGE</var>|:<var>RANGE1</var>:<var>RANGE2</var>]</samp></dt> |
| 1594 |
<dd><p>Set to <var>THRVAL</var> the maximum absolute difference permitted |
| 1595 |
before two numeric fields are regarded as different (The default value is zero). |
| 1596 |
If a <var>RANGE</var> is given, use the specified |
| 1597 |
threshold only when comparing fields whose indexes lie in <var>RANGE</var>. |
| 1598 |
If both <var>RANGE1</var> and <var>RANGE2</var> are given and have the same length, |
| 1599 |
then use the specified threshold when comparing a field of <var>FILE1</var> |
| 1600 |
lying in <var>RANGE1</var> with the corresponding field of <var>FILE2</var> in <var>RANGE2</var> |
| 1601 |
</p> |
| 1602 |
</dd> |
| 1603 |
<dt><samp>-r, --relative-tolerance=<var>THRVAL</var>[:<var>RANGE</var>|:<var>RANGE1</var>:<var>RANGE2</var>]</samp></dt> |
| 1604 |
<dd><p>Set to <var>THRVAL</var> the maximum relative difference permitted |
| 1605 |
before two numeric fields are regarded as different (The default value is zero). |
| 1606 |
If a <var>RANGE</var> is given, use the specified |
| 1607 |
threshold only when comparing fields whose indexes lie in <var>RANGE</var>. |
| 1608 |
If both <var>RANGE1</var> and <var>RANGE2</var> are given and have the same length, |
| 1609 |
then use the specified threshold when comparing a field of <var>FILE1</var> |
| 1610 |
lying in <var>RANGE1</var> with the corresponding field of <var>FILE2</var> in <var>RANGE2</var> |
| 1611 |
</p> |
| 1612 |
</dd> |
| 1613 |
<dt><samp>-2, --strict</samp></dt> |
| 1614 |
<dd><p>Consider two numerical values as equal only if |
| 1615 |
both absolute and relative difference do not exceed |
| 1616 |
the respective tolerance threshold |
| 1617 |
</p> |
| 1618 |
</dd> |
| 1619 |
<dt><samp>-F, --formula=<var>NUM</var></samp></dt> |
| 1620 |
<dd><p>Use the formula indicated by <var>NUM</var> to compute the relative errors. |
| 1621 |
If <var>NUM</var> is 0 use the classic formula. |
| 1622 |
If <var>NUM</var> is 1 compute the relative errors by considering |
| 1623 |
the values in <var>FILE1</var> as sample values. |
| 1624 |
If <var>NUM</var> is 2 compute the relative errors by considering |
| 1625 |
the values in <var>FILE2</var> as sample values. |
| 1626 |
</p> |
| 1627 |
</dd> |
| 1628 |
<dt><samp>-#, --digits=<var>NUM</var></samp></dt> |
| 1629 |
<dd><p>Set to <var>NUM</var> the number of digits in the significands |
| 1630 |
used in multiple precision arithmetic |
| 1631 |
</p> |
| 1632 |
</dd> |
| 1633 |
<dt><samp>-P, --positive-differences</samp></dt> |
| 1634 |
<dd><p>Ignore all differences due to numeric fields of the second file that |
| 1635 |
are less than the corresponding numeric fields in the first file |
| 1636 |
</p> |
| 1637 |
</dd> |
| 1638 |
<dt><samp>-N, --negative-differences</samp></dt> |
| 1639 |
<dd><p>Ignore all differences due to numeric fields of the second file that |
| 1640 |
are greater than the corresponding numeric fields in the first file |
| 1641 |
</p> |
| 1642 |
</dd> |
| 1643 |
<dt><samp>-I, --ignore-case</samp></dt> |
| 1644 |
<dd><p>Ignore changes in case while doing literal comparisons |
| 1645 |
</p> |
| 1646 |
</dd> |
| 1647 |
<dt><samp>-c, --currency=<var>CURRNAME</var></samp></dt> |
| 1648 |
<dd><p>Set to <var>CURRNAME</var> the currency name for the two files to compare. |
| 1649 |
<var>CURRNAME</var> must be prefixed with ‘<samp>1:</samp>’ or ‘<samp>2:</samp>’ to specify the |
| 1650 |
currency name only for the first or the second file |
| 1651 |
</p> |
| 1652 |
</dd> |
| 1653 |
<dt><samp>-d, --decimal-point=<var>C1C2</var></samp></dt> |
| 1654 |
<dd><p>Specify the characters representing the decimal point |
| 1655 |
in the two files to compare |
| 1656 |
</p> |
| 1657 |
</dd> |
| 1658 |
<dt><samp>-t, --thousands-separator=<var>C1C2</var></samp></dt> |
| 1659 |
<dd><p>Specify the characters representing the thousands separator |
| 1660 |
in the two files to compare |
| 1661 |
</p> |
| 1662 |
</dd> |
| 1663 |
<dt><samp>-g, --group-length=<var>N1N2</var></samp></dt> |
| 1664 |
<dd><p>Specify the number of digits forming each group of thousands |
| 1665 |
in the two files to compare |
| 1666 |
</p> |
| 1667 |
</dd> |
| 1668 |
<dt><samp>-p, --plus-prefix=<var>C1C2</var></samp></dt> |
| 1669 |
<dd><p>Specify the (optional) prefixes for positive values |
| 1670 |
used in the two files to compare |
| 1671 |
</p> |
| 1672 |
</dd> |
| 1673 |
<dt><samp>-n, --minus-prefix=<var>C1C2</var></samp></dt> |
| 1674 |
<dd><p>Specify the prefixes for negative values |
| 1675 |
used in the two files to compare |
| 1676 |
</p> |
| 1677 |
</dd> |
| 1678 |
<dt><samp>-e, --exponent-letter=<var>C1C2</var></samp></dt> |
| 1679 |
<dd><p>Specify the exponent letters |
| 1680 |
used in the two files to compare |
| 1681 |
</p> |
| 1682 |
</dd> |
| 1683 |
<dt><samp>-i, --imaginary-unit=<var>C1C2</var></samp></dt> |
| 1684 |
<dd><p>Specify the characters representing the imaginary unit |
| 1685 |
in the two files to compare |
| 1686 |
</p> |
| 1687 |
</dd> |
| 1688 |
<dt><samp>-X, --exclude=1:<var>RANGE</var></samp></dt> |
| 1689 |
<dd><p>Select the fields of the first file that have to be ignored |
| 1690 |
</p> |
| 1691 |
</dd> |
| 1692 |
<dt><samp>-X, --exclude=2:<var>RANGE</var></samp></dt> |
| 1693 |
<dd><p>Select the fields of the second file that have to be ignored |
| 1694 |
</p> |
| 1695 |
</dd> |
| 1696 |
<dt><samp>-E, --essential</samp></dt> |
| 1697 |
<dd><p>While printing the differences between the two compared files |
| 1698 |
show only the numerical ones |
| 1699 |
</p> |
| 1700 |
</dd> |
| 1701 |
<dt><samp>-U, --dummy</samp></dt> |
| 1702 |
<dd><p>While printing the differences between the two compared files |
| 1703 |
neglect all the numerical ones (dummy mode) |
| 1704 |
</p> |
| 1705 |
</dd> |
| 1706 |
<dt><samp>-b, --brief</samp></dt> |
| 1707 |
<dd><p>Suppress all messages concerning the differences discovered |
| 1708 |
in the structures of the two files |
| 1709 |
</p> |
| 1710 |
</dd> |
| 1711 |
<dt><samp>-V, --verbose</samp></dt> |
| 1712 |
<dd><p>For every couple of lines which differ in at least one field print an header |
| 1713 |
to show how these lines appear in the two compared files |
| 1714 |
</p> |
| 1715 |
</dd> |
| 1716 |
<dt><samp>-O, --overview[=<var>NUM</var>]</samp></dt> |
| 1717 |
<dd><p>Display a side by side difference listing of the two files |
| 1718 |
showing which lines are present only in one file, which |
| 1719 |
lines are present in both files but with one or more differing fields, |
| 1720 |
and which lines are identical. |
| 1721 |
If <var>NUM</var> is zero or is not specified, output at most 130 columns per line. |
| 1722 |
If <var>NUM</var> is a positive number, output at most <var>NUM</var> columns per line. |
| 1723 |
If <var>NUM</var> is a negative number, do not output common lines |
| 1724 |
and display at most -<var>NUM</var> columns per line. |
| 1725 |
</p> |
| 1726 |
</dd> |
| 1727 |
<dt><samp>--raw</samp></dt> |
| 1728 |
<dd><p>Display the differences between the two compared files |
| 1729 |
in raw format (not very convenient for humans) |
| 1730 |
</p> |
| 1731 |
</dd> |
| 1732 |
<dt><samp>-q, --quiet, --silent</samp></dt> |
| 1733 |
<dd><p>Suppress all the standard output |
| 1734 |
</p> |
| 1735 |
</dd> |
| 1736 |
<dt><samp>-S, --statistics</samp></dt> |
| 1737 |
<dd><p>Add some statistics to the standard output |
| 1738 |
</p> |
| 1739 |
</dd> |
| 1740 |
<dt><samp>-z, --blur-if-numerical=1:<var>RANGE</var></samp></dt> |
| 1741 |
<dd><p>Select the fields of the first file that have to be |
| 1742 |
blurred during the synchronization procedure |
| 1743 |
only if they turn out to be numeric |
| 1744 |
</p> |
| 1745 |
</dd> |
| 1746 |
<dt><samp>-z, --blur-if-numerical=2:<var>RANGE</var></samp></dt> |
| 1747 |
<dd><p>Select the fields of the second file that have to be |
| 1748 |
blurred during the synchronization procedure |
| 1749 |
only if they turn out to be numeric |
| 1750 |
</p> |
| 1751 |
</dd> |
| 1752 |
<dt><samp>-Z, --blur-unconditionally=1:<var>RANGE</var></samp></dt> |
| 1753 |
<dd><p>Select the fields of the first file that have to be |
| 1754 |
unconditionally blurred during the synchronization procedure |
| 1755 |
</p> |
| 1756 |
</dd> |
| 1757 |
<dt><samp>-Z, --blur-unconditionally=2:<var>RANGE</var></samp></dt> |
| 1758 |
<dd><p>Select the fields of the second file that have to be |
| 1759 |
unconditionally blurred during the synchronization procedure |
| 1760 |
</p> |
| 1761 |
</dd> |
| 1762 |
<dt><samp>-m, --minimal</samp></dt> |
| 1763 |
<dd><p>During synchronization try hard to find a smaller set of changes |
| 1764 |
</p> |
| 1765 |
</dd> |
| 1766 |
<dt><samp>-H, --speed-large-files</samp></dt> |
| 1767 |
<dd><p>During synchronization assume large files and |
| 1768 |
many scattered small changes |
| 1769 |
</p> |
| 1770 |
</dd> |
| 1771 |
<dt><samp>-f, --test-filter[=<var>NUM</var>]</samp></dt> |
| 1772 |
<dd><p>Run only the filter and then show the results of its |
| 1773 |
attempt to synchronize the two files. |
| 1774 |
If <var>NUM</var> is zero or is not specified, output at most 130 columns per line. |
| 1775 |
If <var>NUM</var> is a positive number, output at most |
| 1776 |
<var>NUM</var> columns per line. |
| 1777 |
If <var>NUM</var> is a negative number, do not output common lines |
| 1778 |
and display at most -<var>NUM</var> columns per line. |
| 1779 |
</p> |
| 1780 |
</dd> |
| 1781 |
<dt><samp>-T, --expand-tabs</samp></dt> |
| 1782 |
<dd><p>Expand tabs to spaces in output while displaying the results of the |
| 1783 |
synchronization procedure (meaningful only together with option <samp>-O</samp> |
| 1784 |
or <samp>-f</samp>) |
| 1785 |
</p> |
| 1786 |
</dd> |
| 1787 |
<dt><samp>-B, --binary</samp></dt> |
| 1788 |
<dd><p>Treat both files as binary files (only meaningful under Doz/Windoz) |
| 1789 |
</p> |
| 1790 |
</dd> |
| 1791 |
<dt><samp>-l, --warnings-to=<var>PATH</var></samp></dt> |
| 1792 |
<dd><p>Redirect warning and error messages from stderr to the indicated file |
| 1793 |
</p> |
| 1794 |
</dd> |
| 1795 |
<dt><samp>-o, --output=<var>PATH</var></samp></dt> |
| 1796 |
<dd><p>Redirect output from stdout to the indicated file |
| 1797 |
</p> |
| 1798 |
</dd> |
| 1799 |
<dt><samp>-h, --help</samp></dt> |
| 1800 |
<dd><p>Show help message and predefined settings |
| 1801 |
</p> |
| 1802 |
</dd> |
| 1803 |
<dt><samp>-v, --version</samp></dt> |
| 1804 |
<dd><p>Show version number, Copyright, Distribution Terms and NO-Warranty |
| 1805 |
</p></dd> |
| 1806 |
</dl> |
| 1807 |
|
| 1808 |
<p><strong>DIAGNOSTICS</strong> |
| 1809 |
</p> |
| 1810 |
<p>The exit status is 1 if the two given files differ, 0 if they are equal, |
| 1811 |
-1 (255) in case of error. |
| 1812 |
</p> |
| 1813 |
<p><strong>DEFAULT NUMERIC FORMAT (for both files to compare):</strong> |
| 1814 |
<a name="Default-Numeric-Format"></a></p> |
| 1815 |
<p>Currency name = "" |
| 1816 |
</p><br> |
| 1817 |
<p>Decimal point = ‘.’ |
| 1818 |
</p><br> |
| 1819 |
<p>Thousands separator = ‘,’ |
| 1820 |
</p><br> |
| 1821 |
<p>Number of digits in each thousands group = 3 |
| 1822 |
</p><br> |
| 1823 |
<p>Leading positive sign = ‘+’ |
| 1824 |
</p><br> |
| 1825 |
<p>Leading negative sign = ‘-’ |
| 1826 |
</p><br> |
| 1827 |
<p>Prefix for decimal exponent = ‘e’ |
| 1828 |
</p><br> |
| 1829 |
<p>Symbol used to denote the imaginary unit = ‘i’ |
| 1830 |
</p> |
| 1831 |
<p><strong>SOME EXPLANATIONS</strong> |
| 1832 |
</p> |
| 1833 |
<p>The options <samp>-U</samp>, <samp>-E</samp>, <samp>-b</samp>, and |
| 1834 |
<samp>-q</samp> are used to hide part of the standard output of the program |
| 1835 |
according to certain rules. |
| 1836 |
</p> |
| 1837 |
<p>The option <samp>-U</samp> triggers the <i>dummy mode</i>. In this mode |
| 1838 |
<code>numdiff</code> does not print the numerical differences. A numerical |
| 1839 |
difference occurs whenever the compared fields turn out to be both of numerical |
| 1840 |
type, but the field from the second file has a value |
| 1841 |
which differs from the one of the field from the first file. |
| 1842 |
The <i>dummy mode</i> is so called since in this mode |
| 1843 |
<code>numdiff</code> does not perform the job for which I created it. |
| 1844 |
</p> |
| 1845 |
<p>The option <samp>-E</samp> triggers the <i>essential mode</i>. In this mode |
| 1846 |
<code>numdiff</code> only prints the numerical differences between the |
| 1847 |
files and, if there are some, the differences in the |
| 1848 |
structure. The latter ones occur either when one of |
| 1849 |
the files contains a line for which there is no |
| 1850 |
corresponding line in the other file, or |
| 1851 |
when the comparison of corresponding lines shows |
| 1852 |
that one of them contains a field for which there exists no |
| 1853 |
corresponding field in the other line. |
| 1854 |
If you are not running any filter or cutting out any |
| 1855 |
fields through the option <samp>-X</samp>, then |
| 1856 |
the differences in the structure simply consist either |
| 1857 |
in a different number of lines in the |
| 1858 |
two files, or in a different number of fields on a line. |
| 1859 |
</p> |
| 1860 |
<p>The option <samp>-b</samp> triggers the <i>brief mode</i>. In this mode |
| 1861 |
<code>numdiff</code> does not print the differences in |
| 1862 |
the structure of the two files (see above for an explanation |
| 1863 |
about what differences in the structure are). |
| 1864 |
</p> |
| 1865 |
<p>The option <samp>-q</samp> triggers the <i>quiet mode</i>. |
| 1866 |
In this mode <code>numdiff</code> does not print anything on the |
| 1867 |
standard output. The <i>quiet mode</i> is useful if you only want |
| 1868 |
to know whether a couple of files are equal or not. |
| 1869 |
This information can be obtained by looking at the exit status |
| 1870 |
of the program. |
| 1871 |
</p> |
| 1872 |
<p>The option <samp>-O</samp> activates the <i>overview mode</i>, |
| 1873 |
which makes <code>numdiff</code> print a side-by-side report |
| 1874 |
in the form described in section <a href="#Overview-mode">Overview mode</a>. |
| 1875 |
The optional numeric argument after <samp>-O</samp> must immediately |
| 1876 |
follow, intermediate spaces are not allowed. |
| 1877 |
The option <samp>-O</samp> can be used together with any other option |
| 1878 |
of Numdiff except for <samp>-f</samp>, <samp>-q</samp>, <samp>-U</samp>, <samp>-E</samp>, |
| 1879 |
<samp>-V</samp>, <samp>-b</samp>, and <samp>--raw</samp>. |
| 1880 |
Whenever <samp>-O</samp> is in use, <samp>-U</samp>, <samp>-E</samp>, |
| 1881 |
<samp>-V</samp> and <samp>-b</samp> are ignored. |
| 1882 |
If <samp>--raw</samp> or <samp>-q</samp> is present on the command line together |
| 1883 |
with <samp>-O</samp>, then <samp>-O</samp> is ignored. |
| 1884 |
Finally, if both <samp>-f</samp> and <samp>-O</samp> are |
| 1885 |
present, the behavior of Numdiff will depend on their order: |
| 1886 |
the option which appears first on the command line is the |
| 1887 |
one which matters. |
| 1888 |
</p> |
| 1889 |
<p>The option <samp>-V</samp> triggers the <i>verbose mode</i>. In this |
| 1890 |
mode <code>numdiff</code> produces a richer report by printing an header |
| 1891 |
whenever the compared lines differ. The header shows |
| 1892 |
how and where these lines appear in the compared files. |
| 1893 |
For instance, if the files <samp>data1</samp> and <samp>data2</samp> contain the data |
| 1894 |
</p><pre class="verbatim">12 33 |
| 1895 |
22 44.5 |
| 1896 |
0.008 1.002 |
| 1897 |
221.12 -34.56 water |
| 1898 |
2101.21 boats |
| 1899 |
</pre> |
| 1900 |
<p>and |
| 1901 |
</p> |
| 1902 |
<pre class="verbatim">12 33 |
| 1903 |
22.3 44.5 |
| 1904 |
0.008 1.202 |
| 1905 |
221.12 -34.56 |
| 1906 |
2101.21 boats dogs |
| 1907 |
</pre> |
| 1908 |
<p>respectively, then the command ‘<samp>numdiff -V data1 data2</samp>’ |
| 1909 |
will print the following output: |
| 1910 |
</p><div class="example"> |
| 1911 |
<pre class="example">---------------- |
| 1912 |
##2 <== 22 44.5 |
| 1913 |
##2 ==> 22.3 44.5 |
| 1914 |
|
| 1915 |
##2 #:1 <== 22 |
| 1916 |
##2 #:1 ==> 22.3 |
| 1917 |
@ Absolute error = 3.0000000000e-1, Relative error = 1.3636363636e-2 |
| 1918 |
---------------- |
| 1919 |
##3 <== 0.008 1.002 |
| 1920 |
##3 ==> 0.008 1.202 |
| 1921 |
|
| 1922 |
##3 #:2 <== 1.002 |
| 1923 |
##3 #:2 ==> 1.202 |
| 1924 |
@ Absolute error = 2.0000000000e-1, Relative error = 1.9960079840e-1 |
| 1925 |
---------------- |
| 1926 |
##4 <== 221.12 -34.56 water |
| 1927 |
##4 ==> 221.12 -34.56 |
| 1928 |
|
| 1929 |
##4 #>3 <== water |
| 1930 |
##4 ==> |
| 1931 |
@ Line 4 in file "data2" is shorter than expected! |
| 1932 |
---------------- |
| 1933 |
##5 <== 2101.21 boats |
| 1934 |
##5 ==> 2101.21 boats dogs |
| 1935 |
|
| 1936 |
##5 <== |
| 1937 |
##5 #>3 ==> dogs |
| 1938 |
@ Line 5 in file "data1" is shorter than expected! |
| 1939 |
|
| 1940 |
+++ File "data1" differs from file "data2" |
| 1941 |
</pre></div> |
| 1942 |
|
| 1943 |
<p>Mind that the options <samp>-b</samp> and <samp>-V</samp> |
| 1944 |
will be overridden if <samp>-q</samp> is also set. |
| 1945 |
</p> |
| 1946 |
<p>The amount of additional information printed by <samp>-V</samp> is |
| 1947 |
trivially influenced by the options that alter |
| 1948 |
the way <code>numdiff</code> performs the comparisons between fields |
| 1949 |
(for instance <samp>-a</samp>, <samp>-r</samp>, <samp>-2</samp>, <samp>-N</samp>, |
| 1950 |
<samp>-P</samp>, <samp>-U</samp>, <samp>-E</samp>, <samp>-I</samp>, <samp>-X</samp>). |
| 1951 |
</p> |
| 1952 |
<p>In the headers printed by <code>numdiff</code> in “verbose mode” |
| 1953 |
the symbol <tt><<*>></tt> can appear. This symbol, if present, |
| 1954 |
is always located at the end of a line to mean that the line |
| 1955 |
is at the end of the corresponding file and |
| 1956 |
does not have a terminating <strong>newline</strong> character. |
| 1957 |
</p> |
| 1958 |
<p>The option <samp>-S</samp> adds to the standard output of <code>numdiff</code> |
| 1959 |
a statistical report with the following information: |
| 1960 |
</p><ul> |
| 1961 |
<li> the number of numeric comparisons the program has done (this quantity, |
| 1962 |
like the successive ones, is influenced by the options <samp>-P</samp> and |
| 1963 |
<samp>-N</samp>) and the number of those ones whose outcome |
| 1964 |
is a major <a name="DOCF1" href="#FOOT1"><sup>1</sup></a> |
| 1965 |
numerical difference. |
| 1966 |
</li><li> the largest absolute error in the set of major numerical differences |
| 1967 |
together with the corresponding relative error, and the positions of its |
| 1968 |
first occurrences in the compared files, |
| 1969 |
</li><li> the largest relative error in the set of major numerical differences |
| 1970 |
together with the corresponding absolute error, and the positions of its |
| 1971 |
first occurrences in the compared files, |
| 1972 |
</li><li> the sum and the arithmetic mean of all absolute errors, |
| 1973 |
</li><li> the sum and the arithmetic mean of the major absolute errors, |
| 1974 |
</li><li> the square root of the sum of the squares of all absolute errors, |
| 1975 |
</li><li> the square root of the sum of the squares of the major absolute errors, |
| 1976 |
</li><li> the quadratic mean of all absolute errors, and |
| 1977 |
</li><li> the quadratic mean of the major absolute errors. |
| 1978 |
</li></ul> |
| 1979 |
<p>The information printed by <samp>-S</samp> is not |
| 1980 |
removed if this option is used together with <samp>-q</samp>, |
| 1981 |
and is not influenced by the option <samp>--raw</samp>. |
| 1982 |
</p> |
| 1983 |
<p>The options <samp>-a</samp>, <samp>-r</samp>, <samp>-2</samp>, |
| 1984 |
<samp>-P</samp> and <samp>-N</samp> affect the way <code>numdiff</code> |
| 1985 |
performs the comparisons between numerical values. |
| 1986 |
Without any of these options, <code>numdiff</code> considers two |
| 1987 |
numerical fields as equal if their difference is zero. |
| 1988 |
</p> |
| 1989 |
<p>The option <samp>-a</samp> can be used to make |
| 1990 |
two numerical fields be considered equal as long |
| 1991 |
as their absolute difference does not exceed a certain threshold, |
| 1992 |
which is specified by the argument that follows the <samp>-a</samp> option. |
| 1993 |
This argument can take several forms. The basic form consists of a |
| 1994 |
single numerical value, the extended form adds the |
| 1995 |
specification of one or two ranges of integer values. |
| 1996 |
</p> |
| 1997 |
<p>Independently of the form of the argument, if the absolute |
| 1998 |
difference between two fields does not exceed the given threshold value, |
| 1999 |
the fields are considered equal; |
| 2000 |
otherwise, <code>numdiff</code> prints the difference in its report, |
| 2001 |
unless some other option, for example <samp>-P</samp> or <samp>-N</samp>, |
| 2002 |
makes the difference be neglected. |
| 2003 |
If nothing else follows the threshold value, the rule just explained applies |
| 2004 |
to all comparisons between numerical fields. |
| 2005 |
To see this in practice, if the file |
| 2006 |
<samp>many_columns1</samp> contains the text |
| 2007 |
</p><pre class="verbatim">A 1 1.2 1 0.1 11.0 1.0e-1 |
| 2008 |
B 2 2.4 4 0.4 24.0 1.0e-2 |
| 2009 |
C 3 3.6 9 0.9 39.0 1.0e-3 |
| 2010 |
D 4 4.8 16 1.6 416.0 1.0e-4 |
| 2011 |
</pre> |
| 2012 |
<p>and the contents of the file <samp>many_columns2</samp> are given by |
| 2013 |
</p> |
| 2014 |
<pre class="verbatim">A 1.1 1.08 1.01 0.1 11.011 -1.0e-1 |
| 2015 |
B 2.2 2.16 4.04 0.4 24.024 -1.0e-2 |
| 2016 |
C 3.3 3.24 9.09 0.9 39.039 -1.0e-3 |
| 2017 |
D 4.4 4.32 16.16 1.6 416.039 -1.0e-4 |
| 2018 |
</pre> |
| 2019 |
<p>then the output of the command ‘<samp>numdiff -a 0.5 many_columns1 many_columns2</samp>’ |
| 2020 |
will be |
| 2021 |
</p><div class="example"> |
| 2022 |
<pre class="example"> |
| 2023 |
+++ Files "many_columns1" and "many_columns2" are equal |
| 2024 |
</pre></div> |
| 2025 |
|
| 2026 |
<p>The highest absolute difference between a field from |
| 2027 |
<samp>many_columns1</samp> and the corresponding field from <samp>many_columns2</samp> |
| 2028 |
is given indeed by |4.32 - 4.8| = |-0.48| = 0.48, and then all |
| 2029 |
numeric differences between the two files remain below the |
| 2030 |
threshold value 0.5. |
| 2031 |
</p> |
| 2032 |
<p>On the other hand, the command ‘<samp>numdiff -a 0.35 many_columns1 many_columns2</samp>’ |
| 2033 |
prints the report |
| 2034 |
</p><div class="example"> |
| 2035 |
<pre class="example">---------------- |
| 2036 |
##3 #:3 <== 3.6 |
| 2037 |
##3 #:3 ==> 3.24 |
| 2038 |
Absolute error = 3.6000000000e-1, Relative error = 1.1111111111e-1 |
| 2039 |
---------------- |
| 2040 |
##4 #:2 <== 4 |
| 2041 |
##4 #:2 ==> 4.4 |
| 2042 |
Absolute error = 4.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2043 |
##4 #:3 <== 4.8 |
| 2044 |
##4 #:3 ==> 4.32 |
| 2045 |
Absolute error = 4.8000000000e-1, Relative error = 1.1111111111e-1 |
| 2046 |
|
| 2047 |
+++ File "many_columns1" differs from file "many_columns2" |
| 2048 |
</pre></div> |
| 2049 |
|
| 2050 |
<p>since the absolute differences |3.24-3.6| = |-0.36| = 0.36, |
| 2051 |
|4.4-4| = |0.4| = 0.4, and |4.32 - 4.8| = 0.48 exceed |
| 2052 |
the value 0.35, while the other differences are below this threshold. |
| 2053 |
</p> |
| 2054 |
<p>If you want that the specified threshold value applies |
| 2055 |
only when comparing some particular fields, you |
| 2056 |
have to use the extended form for the argument of <samp>-a</samp>. |
| 2057 |
This means that after the threshold value one |
| 2058 |
or two ranges of integer numbers must follow, each |
| 2059 |
preceded by a colon (‘:’). |
| 2060 |
If you specify only one range of numbers after |
| 2061 |
the threshold value, <code>numdiff</code> uses the |
| 2062 |
given threshold only when comparing fields whose positions lie |
| 2063 |
in the specified range. |
| 2064 |
Remember that the positions of the fields on a line |
| 2065 |
are numbered starting from the left hand of the line |
| 2066 |
and proceeding towards the right hand. |
| 2067 |
For example, ‘<samp>-a 0.01:2-5</samp>’ sets the threshold value |
| 2068 |
to 0.01 only for the comparisons between numerical fields |
| 2069 |
which occupy on their lines a position between the second and the fifth one inclusive. |
| 2070 |
For the other comparisons the threshold value is left unchanged; |
| 2071 |
in particular, it is equal to zero if it has not been explicitly set. |
| 2072 |
If the files <samp>many_columns1</samp> and <samp>many_columns2</samp> are the same as before, |
| 2073 |
then the command ‘<samp>numdiff -a 0.5:3-6 many_columns1 many_columns2</samp>’ will |
| 2074 |
display the following report |
| 2075 |
</p><div class="example"> |
| 2076 |
<pre class="example">---------------- |
| 2077 |
##1 #:2 <== 1 |
| 2078 |
##1 #:2 ==> 1.1 |
| 2079 |
Absolute error = 1.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2080 |
##1 #:7 <== 1.0e-1 |
| 2081 |
##1 #:7 ==> -1.0e-1 |
| 2082 |
Absolute error = 2.0000000000e-1, Relative error = 2.0000000000e+0 |
| 2083 |
---------------- |
| 2084 |
##2 #:2 <== 2 |
| 2085 |
##2 #:2 ==> 2.2 |
| 2086 |
Absolute error = 2.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2087 |
##2 #:7 <== 1.0e-2 |
| 2088 |
##2 #:7 ==> -1.0e-2 |
| 2089 |
Absolute error = 2.0000000000e-2, Relative error = 2.0000000000e+0 |
| 2090 |
---------------- |
| 2091 |
##3 #:2 <== 3 |
| 2092 |
##3 #:2 ==> 3.3 |
| 2093 |
Absolute error = 3.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2094 |
##3 #:7 <== 1.0e-3 |
| 2095 |
##3 #:7 ==> -1.0e-3 |
| 2096 |
Absolute error = 2.0000000000e-3, Relative error = 2.0000000000e+0 |
| 2097 |
---------------- |
| 2098 |
##4 #:2 <== 4 |
| 2099 |
##4 #:2 ==> 4.4 |
| 2100 |
Absolute error = 4.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2101 |
##4 #:7 <== 1.0e-4 |
| 2102 |
##4 #:7 ==> -1.0e-4 |
| 2103 |
Absolute error = 2.0000000000e-4, Relative error = 2.0000000000e+0 |
| 2104 |
|
| 2105 |
+++ File "many_columns1" differs from file "many_columns2" |
| 2106 |
</pre></div> |
| 2107 |
|
| 2108 |
<p>since the threshold value 0.5 applies now only when comparing |
| 2109 |
fields in third, fourth, fifth and sixth position, while for the other |
| 2110 |
comparisons the threshold value is the default one, i.e. zero. |
| 2111 |
If you want to specify a non null threshold also for the fields |
| 2112 |
in second and seventh position, you can do it by using the option |
| 2113 |
<samp>-a</samp> more times. The command |
| 2114 |
‘<samp>numdiff -a 0.5:3-6 -a 0.25:2 -a 4e-3:7 many_columns1 many_columns2</samp>’ |
| 2115 |
sets the threshold value to 0.25 for the comparisons between the |
| 2116 |
fields in second position, and to 4e-3 for the comparisons of the |
| 2117 |
fields in seventh position. No wonder then, that the command |
| 2118 |
prints exactly this report: |
| 2119 |
</p><div class="example"> |
| 2120 |
<pre class="example">---------------- |
| 2121 |
##1 #:7 <== 1.0e-1 |
| 2122 |
##1 #:7 ==> -1.0e-1 |
| 2123 |
Absolute error = 2.0000000000e-1, Relative error = 2.0000000000e+0 |
| 2124 |
---------------- |
| 2125 |
##2 #:7 <== 1.0e-2 |
| 2126 |
##2 #:7 ==> -1.0e-2 |
| 2127 |
Absolute error = 2.0000000000e-2, Relative error = 2.0000000000e+0 |
| 2128 |
---------------- |
| 2129 |
##3 #:2 <== 3 |
| 2130 |
##3 #:2 ==> 3.3 |
| 2131 |
Absolute error = 3.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2132 |
---------------- |
| 2133 |
##4 #:2 <== 4 |
| 2134 |
##4 #:2 ==> 4.4 |
| 2135 |
Absolute error = 4.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2136 |
|
| 2137 |
+++ File "many_columns1" differs from file "many_columns2" |
| 2138 |
</pre></div> |
| 2139 |
|
| 2140 |
<p>Observe that <tt>:2</tt> and <tt>:7</tt> are abbreviations |
| 2141 |
of <tt>:2-2</tt> and <tt>:7-7</tt>, respectively. |
| 2142 |
It is even possible to use range expressions like |
| 2143 |
‘<samp><var>m</var>-</samp>’ or ‘<samp>-<var>n</var></samp>’. |
| 2144 |
The first expression means all fields starting from |
| 2145 |
the <var>m</var>th one (inclusive) till to the end of line, |
| 2146 |
the second selects all fields from the first one |
| 2147 |
till to the <var>n</var>th one, both inclusive. |
| 2148 |
</p> |
| 2149 |
<p>If you specify two ranges of numbers after |
| 2150 |
the threshold value and they have the same length |
| 2151 |
(the length of a range is the difference between its maximum and its minimum), |
| 2152 |
<code>numdiff</code> uses the given threshold when |
| 2153 |
comparing a field of the first file |
| 2154 |
lying in the first range with the corresponding field |
| 2155 |
of the second file from the second range. |
| 2156 |
For example, ‘<samp>-a 1e-4:3-5:4-6</samp>’ sets the threshold value |
| 2157 |
to 0.0001 only for the numerical comparisons of the third, |
| 2158 |
fourth, and fifth field of each line from the first file |
| 2159 |
with the fourth, fifth and sixth field respectively |
| 2160 |
of the corresponding line from the second file. |
| 2161 |
For the other comparisons the threshold value is left unchanged |
| 2162 |
and is in particular equal to zero if it has not been |
| 2163 |
explicitly set. This way to restrict the application of |
| 2164 |
a threshold value is useful in conjunction with the |
| 2165 |
option <samp>-X</samp>, which makes <code>numdiff</code> ignore one |
| 2166 |
or more fields from one of the compared files. |
| 2167 |
</p> |
| 2168 |
<p>The file <samp>many_columns3</samp>: |
| 2169 |
</p><pre class="verbatim">A I 1.1 1.08 1.01 0.1 11.011 -1.0e-1 |
| 2170 |
B II 2.2 2.16 4.04 0.4 24.024 -1.0e-2 |
| 2171 |
C III 3.3 3.24 9.09 0.9 39.039 -1.0e-3 |
| 2172 |
D IV 4.4 4.32 16.16 1.6 416.039 -1.0e-4 |
| 2173 |
</pre> |
| 2174 |
<p>has one column more than the file <samp>many_columns1</samp>, namely |
| 2175 |
the second one. When comparing <samp>many_columns1</samp> with |
| 2176 |
<samp>many_columns3</samp> it is natural then to ignore the second |
| 2177 |
column of the second file. This can be achieved by passing |
| 2178 |
the argument 2:2 to the option <samp>-X</samp> (for a full |
| 2179 |
description of the use of this option, |
| 2180 |
see <a href="#Restriction-of-the-comparison-to-particular-fields">Restriction of the comparison to particular fields</a>). |
| 2181 |
Ignoring the second field of each line of <samp>many_columns3</samp> |
| 2182 |
implies that the fields in the third column of this file |
| 2183 |
are compared with the corresponding fields of the second |
| 2184 |
column of <samp>many_columns1</samp>, the fields in the fourth column |
| 2185 |
of <samp>many_columns3</samp> are compared with the ones in the third |
| 2186 |
column of <samp>many_columns1</samp>, and so on. |
| 2187 |
Therefore, if you want to set a threshold value only for the |
| 2188 |
comparisons between some particular fields you have to consider |
| 2189 |
that ‘<samp>-X 2:2</samp>’ makes <code>numdiff</code> compare the |
| 2190 |
first, second, third, fourth, fifth, sixth, and seventh field |
| 2191 |
of each line of <samp>many_columns1</samp> with the first, third, fourth, |
| 2192 |
fifth, sixth, seventh, and eighth field respectively of |
| 2193 |
the corresponding line of <samp>many_columns3</samp>. |
| 2194 |
Therefore, the command ‘<samp>numdiff -X 2:2 -a 0.5:3-6 many_columns1 many_columns3</samp>’ |
| 2195 |
will use 0.5 as threshold value only when comparing |
| 2196 |
the third, fourth, and fifth field of a line from |
| 2197 |
<samp>many_columns1</samp> with the fourth, |
| 2198 |
fifth, and sixth field respectively of the corresponding line |
| 2199 |
of <samp>many_columns3</samp>. |
| 2200 |
This explains why the report of ‘<samp>numdiff -X 2:2 -a 0.5:3-6 many_columns1 many_columns3</samp>’ |
| 2201 |
</p><div class="example"> |
| 2202 |
<pre class="example">---------------- |
| 2203 |
##1 #:2 <== 1 |
| 2204 |
##1 #:3 ==> 1.1 |
| 2205 |
Absolute error = 1.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2206 |
##1 #:6 <== 11.0 |
| 2207 |
##1 #:7 ==> 11.011 |
| 2208 |
Absolute error = 1.1000000000e-2, Relative error = 1.0000000000e-3 |
| 2209 |
##1 #:7 <== 1.0e-1 |
| 2210 |
##1 #:8 ==> -1.0e-1 |
| 2211 |
Absolute error = 2.0000000000e-1, Relative error = 2.0000000000e+0 |
| 2212 |
---------------- |
| 2213 |
##2 #:2 <== 2 |
| 2214 |
##2 #:3 ==> 2.2 |
| 2215 |
Absolute error = 2.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2216 |
##2 #:6 <== 24.0 |
| 2217 |
##2 #:7 ==> 24.024 |
| 2218 |
Absolute error = 2.4000000000e-2, Relative error = 1.0000000000e-3 |
| 2219 |
##2 #:7 <== 1.0e-2 |
| 2220 |
##2 #:8 ==> -1.0e-2 |
| 2221 |
Absolute error = 2.0000000000e-2, Relative error = 2.0000000000e+0 |
| 2222 |
---------------- |
| 2223 |
##3 #:2 <== 3 |
| 2224 |
##3 #:3 ==> 3.3 |
| 2225 |
Absolute error = 3.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2226 |
##3 #:6 <== 39.0 |
| 2227 |
##3 #:7 ==> 39.039 |
| 2228 |
Absolute error = 3.9000000000e-2, Relative error = 1.0000000000e-3 |
| 2229 |
##3 #:7 <== 1.0e-3 |
| 2230 |
##3 #:8 ==> -1.0e-3 |
| 2231 |
Absolute error = 2.0000000000e-3, Relative error = 2.0000000000e+0 |
| 2232 |
---------------- |
| 2233 |
##4 #:2 <== 4 |
| 2234 |
##4 #:3 ==> 4.4 |
| 2235 |
Absolute error = 4.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2236 |
##4 #:6 <== 416.0 |
| 2237 |
##4 #:7 ==> 416.039 |
| 2238 |
Absolute error = 3.9000000000e-2, Relative error = 9.3750000000e-5 |
| 2239 |
##4 #:7 <== 1.0e-4 |
| 2240 |
##4 #:8 ==> -1.0e-4 |
| 2241 |
Absolute error = 2.0000000000e-4, Relative error = 2.0000000000e+0 |
| 2242 |
|
| 2243 |
+++ File "many_columns1" differs from file "many_columns3" |
| 2244 |
</pre></div> |
| 2245 |
|
| 2246 |
<p>does not show the same difference listing of the command |
| 2247 |
‘<samp>numdiff -a 0.5:3-6 many_columns1 many_columns2</samp>’. |
| 2248 |
</p> |
| 2249 |
<p>If what you want is to obtain the same difference listing |
| 2250 |
of ‘<samp>numdiff -a 0.5:3-6 many_columns1 many_columns2</samp>’, then |
| 2251 |
the right command is ‘<samp>numdiff -X 2:2 -a 0.5:3-6:4-7 many_columns1 many_columns3</samp>’. |
| 2252 |
The report printed by this last command is indeed |
| 2253 |
</p><div class="example"> |
| 2254 |
<pre class="example">---------------- |
| 2255 |
##1 #:2 <== 1 |
| 2256 |
##1 #:3 ==> 1.1 |
| 2257 |
Absolute error = 1.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2258 |
##1 #:7 <== 1.0e-1 |
| 2259 |
##1 #:8 ==> -1.0e-1 |
| 2260 |
Absolute error = 2.0000000000e-1, Relative error = 2.0000000000e+0 |
| 2261 |
---------------- |
| 2262 |
##2 #:2 <== 2 |
| 2263 |
##2 #:3 ==> 2.2 |
| 2264 |
Absolute error = 2.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2265 |
##2 #:7 <== 1.0e-2 |
| 2266 |
##2 #:8 ==> -1.0e-2 |
| 2267 |
Absolute error = 2.0000000000e-2, Relative error = 2.0000000000e+0 |
| 2268 |
---------------- |
| 2269 |
##3 #:2 <== 3 |
| 2270 |
##3 #:3 ==> 3.3 |
| 2271 |
Absolute error = 3.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2272 |
##3 #:7 <== 1.0e-3 |
| 2273 |
##3 #:8 ==> -1.0e-3 |
| 2274 |
Absolute error = 2.0000000000e-3, Relative error = 2.0000000000e+0 |
| 2275 |
---------------- |
| 2276 |
##4 #:2 <== 4 |
| 2277 |
##4 #:3 ==> 4.4 |
| 2278 |
Absolute error = 4.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2279 |
##4 #:7 <== 1.0e-4 |
| 2280 |
##4 #:8 ==> -1.0e-4 |
| 2281 |
Absolute error = 2.0000000000e-4, Relative error = 2.0000000000e+0 |
| 2282 |
|
| 2283 |
+++ File "many_columns1" differs from file "many_columns3" |
| 2284 |
</pre></div> |
| 2285 |
|
| 2286 |
<p>and up to the positions of the fields from <samp>many_columns3</samp> |
| 2287 |
coincides with the one of ‘<samp>numdiff -a 0.5:3-6 many_columns1 many_columns2</samp>’. |
| 2288 |
</p> |
| 2289 |
<p>The option <samp>-a</samp> can appear more times on the command line. |
| 2290 |
In case of conflicts, the last setting is the one |
| 2291 |
which matters. |
| 2292 |
If you look at the report of the command |
| 2293 |
‘<samp>numdiff -a 0.5:3-6 -a 0.08:4 many_columns1 many_columns2</samp>’ |
| 2294 |
</p><div class="example"> |
| 2295 |
<pre class="example">---------------- |
| 2296 |
##1 #:2 <== 1 |
| 2297 |
##1 #:2 ==> 1.1 |
| 2298 |
Absolute error = 1.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2299 |
##1 #:7 <== 1.0e-1 |
| 2300 |
##1 #:7 ==> -1.0e-1 |
| 2301 |
Absolute error = 2.0000000000e-1, Relative error = 2.0000000000e+0 |
| 2302 |
---------------- |
| 2303 |
##2 #:2 <== 2 |
| 2304 |
##2 #:2 ==> 2.2 |
| 2305 |
Absolute error = 2.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2306 |
##2 #:7 <== 1.0e-2 |
| 2307 |
##2 #:7 ==> -1.0e-2 |
| 2308 |
Absolute error = 2.0000000000e-2, Relative error = 2.0000000000e+0 |
| 2309 |
---------------- |
| 2310 |
##3 #:2 <== 3 |
| 2311 |
##3 #:2 ==> 3.3 |
| 2312 |
Absolute error = 3.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2313 |
##3 #:4 <== 9 |
| 2314 |
##3 #:4 ==> 9.09 |
| 2315 |
Absolute error = 9.0000000000e-2, Relative error = 1.0000000000e-2 |
| 2316 |
##3 #:7 <== 1.0e-3 |
| 2317 |
##3 #:7 ==> -1.0e-3 |
| 2318 |
Absolute error = 2.0000000000e-3, Relative error = 2.0000000000e+0 |
| 2319 |
---------------- |
| 2320 |
##4 #:2 <== 4 |
| 2321 |
##4 #:2 ==> 4.4 |
| 2322 |
Absolute error = 4.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2323 |
##4 #:4 <== 16 |
| 2324 |
##4 #:4 ==> 16.16 |
| 2325 |
Absolute error = 1.6000000000e-1, Relative error = 1.0000000000e-2 |
| 2326 |
##4 #:7 <== 1.0e-4 |
| 2327 |
##4 #:7 ==> -1.0e-4 |
| 2328 |
Absolute error = 2.0000000000e-4, Relative error = 2.0000000000e+0 |
| 2329 |
|
| 2330 |
+++ File "many_columns1" differs from file "many_columns2" |
| 2331 |
</pre></div> |
| 2332 |
|
| 2333 |
<p>you see that 0.08 and not 0.5 is taken as threshold value |
| 2334 |
for the comparison of the fields in fourth position. |
| 2335 |
</p> |
| 2336 |
<p>Finally, if <samp>-a</samp> is not present on the command line, |
| 2337 |
then the default threshold value of zero applies to all comparisons |
| 2338 |
of numerical fields and any non null absolute difference |
| 2339 |
is considered as significant, unless some other option, |
| 2340 |
for example <samp>-P</samp> or <samp>-N</samp>, makes <code>numdiff</code> ignore it. |
| 2341 |
</p> |
| 2342 |
<p>The option <samp>-r</samp> can be used to make two numerical fields |
| 2343 |
be considered equal as long as their relative difference does |
| 2344 |
not exceed a certain threshold, which is specified by the argument |
| 2345 |
that follows the <samp>-r</samp> option. |
| 2346 |
As for the option <samp>-a</samp>, the argument of <samp>-r</samp> |
| 2347 |
can have several forms. These forms are the same accepted by |
| 2348 |
<samp>-a</samp> and have the same meanings, but the threshold value |
| 2349 |
applies to the relative difference, not to the absolute one. |
| 2350 |
</p> |
| 2351 |
<p>The relative difference is normally defined in this way. |
| 2352 |
If <em>n1</em> is a value from the file |
| 2353 |
specified as first on the command line and <em>n2</em> |
| 2354 |
is the corresponding value from the second file, |
| 2355 |
then the absolute difference is given by the formula <em>A=|n1-n2|</em>. |
| 2356 |
The relative difference <em>R</em> is given by: |
| 2357 |
</p> |
| 2358 |
<ul> |
| 2359 |
<li> <em>R = 0</em> if <em>n1</em> and <em>n2</em> are equal, |
| 2360 |
</li><li> <em>Inf</em> (infinity) if <em>n2</em> differs from <em>n1</em> and |
| 2361 |
at least one of them is zero, |
| 2362 |
</li><li> <em>R = A/ min(|n1|, |n2|)</em> if <em>n1</em> and <em>n2</em> are |
| 2363 |
both non zero and <em>n2</em> differs from <em>n1</em>. <em>min(|n1|, |n2|)</em> |
| 2364 |
denotes the minimum between the absolute value of <em>n1</em> |
| 2365 |
and the absolute value of <em>n2</em>. |
| 2366 |
</li></ul> |
| 2367 |
|
| 2368 |
<p>With this definition of relative difference it turns out that |
| 2369 |
<em>R(n2, n1) = R(n1, n2)</em>: the relative difference |
| 2370 |
does not change if you only change the ordering of the compared files |
| 2371 |
on the command line. |
| 2372 |
</p> |
| 2373 |
<a name="Alternative-formulas-for-the-computation-of-the-relative-difference"></a><p>There are cases when this default definition of |
| 2374 |
relative error makes no sense. This can happen for instance |
| 2375 |
when one of the files is a sample file containing a list of expected data, |
| 2376 |
which could have been computed theoretically or come from experiments in a laboratory. |
| 2377 |
In this case it is more natural to define the relative difference |
| 2378 |
as the ratio between the absolute difference and the absolute |
| 2379 |
value of the number coming from the sample file. |
| 2380 |
If you use the option <samp>-F</samp> together with the argument 1 |
| 2381 |
(or 2), then Numdiff always compute |
| 2382 |
the relative difference as the ratio between the absolute difference and the absolute |
| 2383 |
value of the number from the first file (the second file, respectively). |
| 2384 |
More precisely, with ‘<samp>-F 1</samp>’ |
| 2385 |
the relative difference <em>R</em> is computed according to |
| 2386 |
these rules: |
| 2387 |
</p><ul> |
| 2388 |
<li> <em>R = 0</em> if <em>n1</em> and <em>n2</em> are equal, |
| 2389 |
</li><li> <em>Inf</em> (infinity) if <em>n2</em> differs from <em>n1</em> and |
| 2390 |
<em>n1</em> is zero, |
| 2391 |
</li><li> <em>R = |n1-n2|/ |n1|</em> if <em>n1</em> is not zero |
| 2392 |
and <em>n2</em> differs from <em>n1</em>. |
| 2393 |
</li></ul> |
| 2394 |
|
| 2395 |
<p>With ‘<samp>-F 2</samp>’ the rules become: |
| 2396 |
</p><ul> |
| 2397 |
<li> <em>R = 0</em> if <em>n1</em> and <em>n2</em> are equal, |
| 2398 |
</li><li> <em>Inf</em> (infinity) if <em>n2</em> differs from <em>n1</em> and |
| 2399 |
<em>n2</em> is zero, |
| 2400 |
</li><li> <em>R = |n1-n2|/ |n2|</em> if <em>n2</em> is not zero |
| 2401 |
and <em>n2</em> differs from <em>n1</em>. |
| 2402 |
</li></ul> |
| 2403 |
|
| 2404 |
<p>With the last two sets of rules it is not anymore true |
| 2405 |
that <em>R(n2, n1) = R(n1, n2)</em>: the relative difference |
| 2406 |
changes, in the general case, together with the ordering of the files |
| 2407 |
on the command line. |
| 2408 |
As a simple example, suppose that <var>file1</var> and <var>file2</var> contain |
| 2409 |
</p><pre class="verbatim">1 9.9 0.5 440 |
| 2410 |
</pre> |
| 2411 |
<p>and |
| 2412 |
</p><pre class="verbatim">1.2 8 0.51 400 |
| 2413 |
</pre> |
| 2414 |
<p>respectively. Then |
| 2415 |
‘<samp>numdiff <var>file1</var> <var>file2</var></samp>’ displays |
| 2416 |
</p><div class="example"> |
| 2417 |
<pre class="example">---------------- |
| 2418 |
##1 #:1 <== 1 |
| 2419 |
##1 #:1 ==> 1.2 |
| 2420 |
Absolute error = 2.0000000000e-1, Relative error = 2.0000000000e-1 |
| 2421 |
##1 #:2 <== 9.9 |
| 2422 |
##1 #:2 ==> 8 |
| 2423 |
Absolute error = 1.9000000000e+0, Relative error = 2.3750000000e-1 |
| 2424 |
##1 #:3 <== 0.5 |
| 2425 |
##1 #:3 ==> 0.51 |
| 2426 |
Absolute error = 1.0000000000e-2, Relative error = 2.0000000000e-2 |
| 2427 |
##1 #:4 <== 440 |
| 2428 |
##1 #:4 ==> 400 |
| 2429 |
Absolute error = 4.0000000000e+1, Relative error = 1.0000000000e-1 |
| 2430 |
|
| 2431 |
+++ File "file1" differs from file "file2" |
| 2432 |
</pre></div> |
| 2433 |
|
| 2434 |
<p>‘<samp>numdiff -F 1 <var>file1</var> <var>file2</var></samp>’ |
| 2435 |
prints |
| 2436 |
</p><div class="example"> |
| 2437 |
<pre class="example">---------------- |
| 2438 |
##1 #:1 <== 1 |
| 2439 |
##1 #:1 ==> 1.2 |
| 2440 |
Absolute error = 2.0000000000e-1, Relative error = 2.0000000000e-1 |
| 2441 |
##1 #:2 <== 9.9 |
| 2442 |
##1 #:2 ==> 8 |
| 2443 |
Absolute error = 1.9000000000e+0, Relative error = 1.9191919192e-1 |
| 2444 |
##1 #:3 <== 0.5 |
| 2445 |
##1 #:3 ==> 0.51 |
| 2446 |
Absolute error = 1.0000000000e-2, Relative error = 2.0000000000e-2 |
| 2447 |
##1 #:4 <== 440 |
| 2448 |
##1 #:4 ==> 400 |
| 2449 |
Absolute error = 4.0000000000e+1, Relative error = 9.0909090909e-2 |
| 2450 |
|
| 2451 |
+++ File "file1" differs from file "file2" |
| 2452 |
</pre></div> |
| 2453 |
|
| 2454 |
<p>the output of |
| 2455 |
‘<samp>numdiff -F 2 <var>file1</var> <var>file2</var></samp>’ is |
| 2456 |
</p><div class="example"> |
| 2457 |
<pre class="example">---------------- |
| 2458 |
##1 #:1 <== 1 |
| 2459 |
##1 #:1 ==> 1.2 |
| 2460 |
Absolute error = 2.0000000000e-1, Relative error = 1.6666666667e-1 |
| 2461 |
##1 #:2 <== 9.9 |
| 2462 |
##1 #:2 ==> 8 |
| 2463 |
Absolute error = 1.9000000000e+0, Relative error = 2.3750000000e-1 |
| 2464 |
##1 #:3 <== 0.5 |
| 2465 |
##1 #:3 ==> 0.51 |
| 2466 |
Absolute error = 1.0000000000e-2, Relative error = 1.9607843137e-2 |
| 2467 |
##1 #:4 <== 440 |
| 2468 |
##1 #:4 ==> 400 |
| 2469 |
Absolute error = 4.0000000000e+1, Relative error = 1.0000000000e-1 |
| 2470 |
|
| 2471 |
+++ File "file1" differs from file "file2" |
| 2472 |
</pre></div> |
| 2473 |
|
| 2474 |
<p>‘<samp>numdiff -F 1 -r 0.195 <var>file1</var> <var>file2</var></samp>’ |
| 2475 |
displays |
| 2476 |
</p><div class="example"> |
| 2477 |
<pre class="example">---------------- |
| 2478 |
##1 #:1 <== 1 |
| 2479 |
##1 #:1 ==> 1.2 |
| 2480 |
Absolute error = 2.0000000000e-1, Relative error = 2.0000000000e-1 |
| 2481 |
|
| 2482 |
+++ File "file1" differs from file "file2" |
| 2483 |
</pre></div> |
| 2484 |
|
| 2485 |
<p>and finally, |
| 2486 |
‘<samp>numdiff -F 2 -r 0.195 <var>file1</var> <var>file2</var></samp>’ |
| 2487 |
displays |
| 2488 |
</p><div class="example"> |
| 2489 |
<pre class="example">---------------- |
| 2490 |
##1 #:2 <== 9.9 |
| 2491 |
##1 #:2 ==> 8 |
| 2492 |
Absolute error = 1.9000000000e+0, Relative error = 2.3750000000e-1 |
| 2493 |
|
| 2494 |
+++ File "file1" differs from file "file2" |
| 2495 |
</pre></div> |
| 2496 |
|
| 2497 |
|
| 2498 |
<p>The option <samp>-2</samp> is only meaningful when the user |
| 2499 |
specifies a non-zero tolerance threshold for both |
| 2500 |
absolute and relative difference. Without this option |
| 2501 |
<code>numdiff</code> considers two numerical fields equal |
| 2502 |
as long as at least one between |
| 2503 |
absolute and relative difference does not exceed the |
| 2504 |
corresponding threshold. |
| 2505 |
With the option <samp>-2</samp> <code>numdiff</code> regards two numerical |
| 2506 |
fields as equal only if both absolute and relative difference do not exceed the |
| 2507 |
thresholds of tolerance specified for those fields. |
| 2508 |
For example, if <var>file1</var> contains the unique line |
| 2509 |
</p><pre class="verbatim">100 |
| 2510 |
</pre> |
| 2511 |
<p>and <var>file2</var> the line |
| 2512 |
</p><pre class="verbatim">100.00012 |
| 2513 |
</pre> |
| 2514 |
<p>then the output of the command ‘<samp>numdiff <var>file1</var> <var>file2</var></samp>’ |
| 2515 |
will be |
| 2516 |
</p> |
| 2517 |
<div class="example"> |
| 2518 |
<pre class="example">---------------- |
| 2519 |
##1 #:1 <== 100 |
| 2520 |
==> 100.00012 |
| 2521 |
@ Absolute error = 1.2000000000e-4, Relative error = 1.2000000000e-6 |
| 2522 |
|
| 2523 |
+++ File "<var>file1</var>" differs from file "<var>file2</var>" |
| 2524 |
</pre></div> |
| 2525 |
|
| 2526 |
<p>The output of the commands |
| 2527 |
‘<samp>numdiff -a 1.0e-4 <var>file1</var> <var>file2</var></samp>’ and |
| 2528 |
‘<samp>numdiff -r 1.0e-6 <var>file1</var> <var>file2</var></samp>’ |
| 2529 |
will be the same as above, but |
| 2530 |
‘<samp>numdiff -a 1.0e-4 -r 1.3e-6 <var>file1</var> <var>file2</var></samp>’ and |
| 2531 |
‘<samp>numdiff -a 1.3e-4 -r 1.0e-6 <var>file1</var> <var>file2</var></samp>’ |
| 2532 |
will print the message |
| 2533 |
</p><div class="example"> |
| 2534 |
<pre class="example"> |
| 2535 |
+++ Files "<var>file1</var>" and "<var>file2</var>" are equal |
| 2536 |
</pre></div> |
| 2537 |
|
| 2538 |
<p>since the relative difference is 1.2e-6 < 1.3e-6, |
| 2539 |
the absolute difference is 1.2e-4 < 1.3e-4, and |
| 2540 |
it is sufficient that one of them does not exceed |
| 2541 |
its tolerance threshold. |
| 2542 |
</p> |
| 2543 |
<p>On the other hand, the commands |
| 2544 |
‘<samp>numdiff -a 1.0e-4 -r 1.3e-6 -2 <var>file1</var> <var>file2</var></samp>’ and |
| 2545 |
‘<samp>numdiff -a 1.3e-4 -r 1.0e-6 -2 <var>file1</var> <var>file2</var></samp>’ |
| 2546 |
will both print the message |
| 2547 |
</p> |
| 2548 |
<div class="example"> |
| 2549 |
<pre class="example">---------------- |
| 2550 |
##1 #:1 <== 100 |
| 2551 |
==> 100.00012 |
| 2552 |
@ Absolute error = 1.2000000000e-4, Relative error = 1.2000000000e-6 |
| 2553 |
|
| 2554 |
+++ File "<var>file1</var>" differs from file "<var>file2</var>" |
| 2555 |
</pre></div> |
| 2556 |
|
| 2557 |
<p>since the option <samp>-2</samp> makes <code>numdiff</code> regard two values |
| 2558 |
as equal only if both absolute and relative difference do not exceed |
| 2559 |
the respective threshold of tolerance. |
| 2560 |
</p> |
| 2561 |
<p>The option <samp>-P</samp> makes <code>numdiff</code> consider two values equal |
| 2562 |
whenever the second one, i.e. the value coming from the file specified as last |
| 2563 |
on the command line, is less or equal than the first one, which |
| 2564 |
is the value coming from the file specified as first on the command line. |
| 2565 |
If the values to compare are complex numbers, saying that |
| 2566 |
the second one is less or equal than the first one means that |
| 2567 |
both real and imaginary part of the second value are |
| 2568 |
not greater than real and imaginary part of the first value, respectively. |
| 2569 |
</p> |
| 2570 |
<p>Finally, the option <samp>-N</samp> makes <code>numdiff</code> consider two values equal |
| 2571 |
whenever the second one, i.e. the value coming from the file specified as last |
| 2572 |
on the command line, is greater or equal than the first one, which |
| 2573 |
is the value coming from the file specified as first on the command line. |
| 2574 |
If the values to compare are complex numbers, saying that |
| 2575 |
the second one is greater or equal than the first one means that |
| 2576 |
both real and imaginary part of the second value are |
| 2577 |
not less than real and imaginary part of the first value, respectively. |
| 2578 |
</p> |
| 2579 |
<p>The options <samp>-B</samp>, <samp>-I</samp>, <samp>-l</samp>, <samp>-o</samp>, <samp>-h</samp>, and |
| 2580 |
<samp>-v</samp> do not require further explanations. |
| 2581 |
The options <samp>-l</samp> and <samp>-o</samp> are only supplied |
| 2582 |
for the users of poorly designed operating systems, |
| 2583 |
whose default shell does not allow the redirection of |
| 2584 |
standard error and standard output. |
| 2585 |
The option <samp>-I</samp> has no effect on the outcome |
| 2586 |
of numerical comparisons but affects the action of |
| 2587 |
the filter, see <a href="#Filtering">Filtering</a>. |
| 2588 |
</p> |
| 2589 |
<p>The option <samp>-s</samp> requires as argument a set of characters, |
| 2590 |
which will be taken as field delimiters. |
| 2591 |
It is better to quote the set of the delimiters, |
| 2592 |
just as in the next examples: |
| 2593 |
</p> |
| 2594 |
<div class="example"> |
| 2595 |
<pre class="example">numdiff -s ' \t\n,;:.' <var>file1</var> <var>file2</var> |
| 2596 |
numdiff -s ' \t\n\r\f\v"\:;' <var>file1</var> <var>file2</var> |
| 2597 |
numdiff -s `` \t\n''' <var>file1</var> <var>file2</var> |
| 2598 |
</pre></div> |
| 2599 |
|
| 2600 |
<p>If you want to include in the set of delimiters also |
| 2601 |
some special characters, e.g. the <strong>blank</strong>, then |
| 2602 |
you must quote it. |
| 2603 |
I recommend you to always use the single quote character |
| 2604 |
(<tt>'</tt>) to enclose the list of the delimiters, |
| 2605 |
since in this way you will prevent |
| 2606 |
any substitution or handling of characters by the shell. |
| 2607 |
</p> |
| 2608 |
<p><code>numdiff</code> recognizes and interprets |
| 2609 |
the following sequences of characters within the argument |
| 2610 |
passed to the option <samp>-s</samp>: |
| 2611 |
</p> |
| 2612 |
<ul> |
| 2613 |
<li> ‘<samp>\a</samp>’ alert (bell), |
| 2614 |
</li><li> ‘<samp>\b</samp>’ backspace, |
| 2615 |
</li><li> ‘<samp>\f</samp>’ form feed, |
| 2616 |
</li><li> ‘<samp>\n</samp>’ newline, |
| 2617 |
</li><li> ‘<samp>\r</samp>’ carriage return, |
| 2618 |
</li><li> ‘<samp>\s</samp>’ blank, |
| 2619 |
</li><li> ‘<samp>\t</samp>’ horizontal tab, |
| 2620 |
</li><li> ‘<samp>\v</samp>’ vertical tab, |
| 2621 |
</li><li> ‘<samp>\\</samp>’ backslash, |
| 2622 |
</li><li> ‘<samp>\<var>nnn</var></samp>’ the eight-bit character whose value is the octal value <var>nnn</var> (one to three digits), |
| 2623 |
</li><li> ‘<samp>\x<var>HH</var></samp>’ the eight-bit character whose value is the hexadecimal value <var>HH</var> (one or two digits). |
| 2624 |
</li></ul> |
| 2625 |
|
| 2626 |
<p>Thus, by passing the string ‘<samp> \t\n,;:.</samp>’ as argument |
| 2627 |
for the option <samp>-s</samp> one tells <code>numdiff</code> to use |
| 2628 |
as field delimiters the characters <strong>blank</strong>, |
| 2629 |
<strong>horizontal tab</strong>, <strong>newline</strong>, <strong>comma</strong>, |
| 2630 |
<strong>semicolon</strong>, <strong>colon</strong>, and <strong>dot</strong>. |
| 2631 |
Passing ‘<samp> \t\n</samp>’ as argument to the option <samp>-s</samp> |
| 2632 |
is the same as not using at all the option <samp>-s</samp>, since |
| 2633 |
<strong>blank</strong>, <strong>horizontal tab</strong>, and <strong>newline</strong> |
| 2634 |
are the default field delimiters. |
| 2635 |
</p> |
| 2636 |
<p>In the list of field delimiters the character <strong>backslash</strong> |
| 2637 |
(‘<samp>\</samp>’) is always treated in a special way. |
| 2638 |
If it forms, combined with the subsequent character(s), one |
| 2639 |
of the escape sequences listed above, then it is |
| 2640 |
considered to be an escape character, and the whole escape sequence is |
| 2641 |
decoded as shown above. Otherwise, the <strong>backslash</strong> is just ignored. |
| 2642 |
</p> |
| 2643 |
<p>Therefore, the delimiters specified by the command line |
| 2644 |
</p> |
| 2645 |
<div class="example"> |
| 2646 |
<pre class="example">numdiff -s' \t\n\\\"' <var>file1</var> <var>file2</var> |
| 2647 |
</pre></div> |
| 2648 |
|
| 2649 |
<p>are <strong>blank</strong>, <strong>horizontal tab</strong>, <strong>newline</strong>, |
| 2650 |
<strong>backslash</strong> and <strong>double quote</strong>, since |
| 2651 |
‘<samp>\\</samp>’ and ‘<samp>\"</samp>’ are interpreted by <code>numdiff</code> |
| 2652 |
as ‘<samp>\</samp>’ and ‘<samp>"</samp>’. |
| 2653 |
</p> |
| 2654 |
<p>Even if I have recommended to enclose the set of |
| 2655 |
delimiters in single quotes, there are |
| 2656 |
cases in which you will be forced to use |
| 2657 |
the double quote character (‘<samp>"</samp>’) to enclose |
| 2658 |
the set of field delimiters, e.g. if the single |
| 2659 |
quote character is used itself as field delimiter, like |
| 2660 |
in one of the precedent examples. |
| 2661 |
However, you must take into account that in this case |
| 2662 |
the shell could make some substitutions on the command line |
| 2663 |
before executing <code>numdiff</code>. |
| 2664 |
For instance, if your shell is GNU bash, then (citing the man page of |
| 2665 |
GNU bash) |
| 2666 |
</p><blockquote> |
| 2667 |
<p>Enclosing characters in double quotes preserves the literal value of |
| 2668 |
all characters within the quotes, with the exception of ‘<samp>$</samp>’, |
| 2669 |
‘<samp>`</samp>’, and ‘<samp>\</samp>’. |
| 2670 |
The characters ‘<samp>$</samp>’ and ‘<samp>`</samp>’ retain their special |
| 2671 |
meaning within double quotes. |
| 2672 |
The backslash retains its special meaning only when followed by one of |
| 2673 |
the following characters: ‘<samp>$</samp>’, ‘<samp>`</samp>’, ‘<samp>"</samp>’, |
| 2674 |
‘<samp>\</samp>’, or <strong><newline></strong>. |
| 2675 |
A double quote may be quoted within double quotes by preceding |
| 2676 |
it with a backslash <small class="enddots">...</small> |
| 2677 |
The special parameters * and @ have special meaning when in double quotes |
| 2678 |
… |
| 2679 |
</p></blockquote> |
| 2680 |
|
| 2681 |
<p>Therefore, if the set of delimiters is formed by ‘<samp> </samp>’, ‘<samp>\t</samp>’, |
| 2682 |
‘<samp>\n</samp>’, ‘<samp>\</samp>’ and ‘<samp>"</samp>’, and you decide to enclose them |
| 2683 |
in double quotes, the <code>numdiff</code> command line should be |
| 2684 |
</p> |
| 2685 |
<div class="example"> |
| 2686 |
<pre class="example">numdiff -s'' \t\n\\\\\"'' <var>file1</var> <var>file2</var> |
| 2687 |
</pre></div> |
| 2688 |
|
| 2689 |
<p>and not |
| 2690 |
</p> |
| 2691 |
<div class="example"> |
| 2692 |
<pre class="example">numdiff -s'' \t\n\\\"'' <var>file1</var> <var>file2</var> |
| 2693 |
</pre></div> |
| 2694 |
|
| 2695 |
<p>In the latter case the shell would indeed replace the string |
| 2696 |
</p> |
| 2697 |
<p>‘<samp> \t\n\\\"</samp>’ |
| 2698 |
</p> |
| 2699 |
<p>by |
| 2700 |
</p> |
| 2701 |
<p>‘<samp> \t\n\"</samp>’ |
| 2702 |
</p> |
| 2703 |
<p>and then <code>numdiff</code> would take ‘<samp> </samp>’, ‘<samp>\t</samp>’, ‘<samp>\n</samp>’ |
| 2704 |
and ‘<samp>"</samp>’ as field delimiters. |
| 2705 |
</p> |
| 2706 |
<p><code>numdiff</code> requires the presence of the <strong>newline</strong> |
| 2707 |
in the set of characters passed to <samp>-s</samp>. The absence |
| 2708 |
of the <strong>newline</strong> in the set of delimiters causes the issue |
| 2709 |
of a warning message and the termination of the program. |
| 2710 |
</p> |
| 2711 |
<p>If you run Numdiff with the option <samp>-B</samp> (<samp>--binary</samp>) |
| 2712 |
on files created under MSDog/MSWindoze, then you should |
| 2713 |
put the <strong>carriage return</strong> in the set of field delimiters. |
| 2714 |
Otherwise, this character would be included in all the fields |
| 2715 |
which stay at the end of a line and this would cause some |
| 2716 |
undesirable effects. For instance, a number put at the |
| 2717 |
end of a line would not be regarded as a numerical field |
| 2718 |
by <code>numdiff</code>, since <code>numdiff</code> would consider |
| 2719 |
the final <strong>carriage return</strong> as part of the field, and |
| 2720 |
this one would be then qualified as non-numerical. |
| 2721 |
</p> |
| 2722 |
<p>You can specify different delimiters for the two files to compare |
| 2723 |
by putting the prefix ‘<samp>1:</samp>’ or ‘<samp>2:</samp>’ in front of the |
| 2724 |
set of characters passed to <samp>-s</samp>. |
| 2725 |
If the argument of <samp>-s</samp> begins with ‘<samp>1:</samp>’, the |
| 2726 |
characters after this prefix are used as field delimiters |
| 2727 |
only for the file passed as first on the command line. |
| 2728 |
Analogously, if the prefix is ‘<samp>2:</samp>’, then the |
| 2729 |
characters after it are used as field delimiters only |
| 2730 |
for the file specified as second on the command line. |
| 2731 |
You can also provide an explicit set of |
| 2732 |
delimiters for just one of the files to compare, |
| 2733 |
in which case <code>numdiff</code> uses the default field |
| 2734 |
delimiters <strong>blank</strong>, <strong>tab</strong> and <strong>newline</strong> |
| 2735 |
for the other file. |
| 2736 |
Therefore, with |
| 2737 |
‘<samp>numdiff -s '1:: \n' <var>file1</var> <var>file2</var></samp>’ |
| 2738 |
the program will take <strong>colon</strong>, <strong>blank</strong> |
| 2739 |
and <strong>newline</strong> as delimiters for <var>file1</var>, |
| 2740 |
and <strong>blank</strong>, <strong>tab</strong> and |
| 2741 |
<strong>newline</strong> as delimiters for <var>file2</var>. |
| 2742 |
The recommendations about quoting the set of delimiters |
| 2743 |
are valid also in presence of a prefix. |
| 2744 |
</p> |
| 2745 |
<p>Starting from version 5.8 <code>numdiff</code> allows to specify |
| 2746 |
whole strings as field delimiters instead of single characters. |
| 2747 |
To this purpose the option <samp>-D</samp> is provided. |
| 2748 |
Assume that file <samp>register1</samp> and file <samp>register2</samp> contain |
| 2749 |
</p><pre class="verbatim">--A: +1.0--- |
| 2750 |
--B: -2.0--- |
| 2751 |
--C: +3.0--- |
| 2752 |
--D: -4.0--- |
| 2753 |
--E: +5.0--- |
| 2754 |
--F: -6.0--- |
| 2755 |
</pre> |
| 2756 |
<p>and |
| 2757 |
</p><pre class="verbatim">--a: +1.1--- |
| 2758 |
--b: -2.2--- |
| 2759 |
--c: +3.3--- |
| 2760 |
--d: -4.4--- |
| 2761 |
--e: +5.5--- |
| 2762 |
--f: -6.6--- |
| 2763 |
</pre> |
| 2764 |
<p>respectively. Assume in addition, you would like that the dashes |
| 2765 |
at the begin and at the end of every line are treated as delimiters and then |
| 2766 |
neglected during the line by line comparison. To obtain this you cannot just |
| 2767 |
specify the character <tt>-</tt> (minus) as delimiter via the option |
| 2768 |
<samp>-s</samp>: if you do it, the negative numbers appearing in the |
| 2769 |
two files will be treated as positive, since the minus sign will be regarded |
| 2770 |
as a delimiter. By means of the option <samp>-D</samp> you can tell <code>numdiff</code> |
| 2771 |
to consider the strings <tt>--</tt> and <tt>---</tt> as field delimiters, |
| 2772 |
but not the single character <tt>-</tt>. |
| 2773 |
To see this in practice, look at the output of the command |
| 2774 |
‘<samp>numdiff -D ': -- --- \s \n' register1 register2</samp>’: |
| 2775 |
</p><div class="example"> |
| 2776 |
<pre class="example">---------------- |
| 2777 |
##1 #:1 <== A |
| 2778 |
##1 #:1 ==> a |
| 2779 |
@ |
| 2780 |
##1 #:2 <== +1.0 |
| 2781 |
##1 #:2 ==> +1.1 |
| 2782 |
Absolute error = 1.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2783 |
---------------- |
| 2784 |
##2 #:1 <== B |
| 2785 |
##2 #:1 ==> b |
| 2786 |
@ |
| 2787 |
##2 #:2 <== -2.0 |
| 2788 |
##2 #:2 ==> -2.2 |
| 2789 |
Absolute error = 2.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2790 |
---------------- |
| 2791 |
##3 #:1 <== C |
| 2792 |
##3 #:1 ==> c |
| 2793 |
@ |
| 2794 |
##3 #:2 <== +3.0 |
| 2795 |
##3 #:2 ==> +3.3 |
| 2796 |
Absolute error = 3.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2797 |
---------------- |
| 2798 |
##4 #:1 <== D |
| 2799 |
##4 #:1 ==> d |
| 2800 |
@ |
| 2801 |
##4 #:2 <== -4.0 |
| 2802 |
##4 #:2 ==> -4.4 |
| 2803 |
Absolute error = 4.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2804 |
---------------- |
| 2805 |
##5 #:1 <== E |
| 2806 |
##5 #:1 ==> e |
| 2807 |
@ |
| 2808 |
##5 #:2 <== +5.0 |
| 2809 |
##5 #:2 ==> +5.5 |
| 2810 |
Absolute error = 5.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2811 |
---------------- |
| 2812 |
##6 #:1 <== F |
| 2813 |
##6 #:1 ==> f |
| 2814 |
@ |
| 2815 |
##6 #:2 <== -6.0 |
| 2816 |
##6 #:2 ==> -6.6 |
| 2817 |
Absolute error = 6.0000000000e-1, Relative error = 1.0000000000e-1 |
| 2818 |
|
| 2819 |
+++ File "register1" differs from file "register2" |
| 2820 |
</pre></div> |
| 2821 |
|
| 2822 |
<p>The argument ‘<samp>-D ': -- --- \s \n'</samp>’ instructs <code>numdiff</code> to |
| 2823 |
regard every occurrence of a colon (<tt>:</tt>), of a blank (<tt>\s</tt>), |
| 2824 |
of a newline (<tt>\n</tt>), as well as every occurrence of the strings |
| 2825 |
<tt>--</tt> and <tt>---</tt> as field delimiters. The minus sign in |
| 2826 |
front of the negative numbers is then properly handled. |
| 2827 |
</p> |
| 2828 |
<p>In general the argument to the option <samp>-D</samp> is a blank |
| 2829 |
separated sequence of one or more strings each of which contains |
| 2830 |
no blank. |
| 2831 |
Thus, the general form of the argument to the option <samp>-D</samp> is |
| 2832 |
</p><div class="example"> |
| 2833 |
<pre class="example"><var>string1</var> <var>string2</var> ... <var>stringN</var> |
| 2834 |
</pre></div> |
| 2835 |
|
| 2836 |
<p>where <var>string1</var>, <var>string2</var>, and so on are sequences of one or |
| 2837 |
more characters (strings) containing no blank. |
| 2838 |
</p> |
| 2839 |
<p>Mind that at least one of these strings must be ‘<samp>\n</samp>’. |
| 2840 |
In addition, if a string contains the newline character, this |
| 2841 |
must be the only one: strings like ‘<samp>#\n</samp>’, ‘<samp>%%\n</samp>’, or |
| 2842 |
‘<samp>\s\n</samp>’ are not allowed (entering such a string makes |
| 2843 |
the program terminate after issuing a warning message). |
| 2844 |
</p> |
| 2845 |
<p>Since the blank character has a special meaning for the shell, if |
| 2846 |
the argument of <samp>-D</samp> is formed by two or more strings |
| 2847 |
it should be quoted either with a single (‘<samp>'</samp>’) |
| 2848 |
or with a double quote (‘<samp>"</samp>’). |
| 2849 |
Quoting is also adviced if one of the strings passed to <samp>-D</samp> |
| 2850 |
contains a character (or a sequence of characters) |
| 2851 |
having a special meaning for the shell. |
| 2852 |
</p> |
| 2853 |
<p>For the usage of single and double quoting to delimit |
| 2854 |
the argument of <samp>-D</samp> the same warnings and recommendations |
| 2855 |
apply as for the argument of <samp>-s</samp>. |
| 2856 |
</p> |
| 2857 |
<p>If you want to set as delimiter a string which contains one or more blanks, |
| 2858 |
then you have to make use of the escape sequence <samp>\s</samp>, |
| 2859 |
like in the example above: within the argument of <samp>-D</samp> the blank |
| 2860 |
character is always interpreted as a separator of adjacent delimiters. |
| 2861 |
</p> |
| 2862 |
<p>More generally, when writing the argument of <samp>-D</samp> |
| 2863 |
the same escape sequences are allowed as for the argument of <samp>-s</samp>. |
| 2864 |
This turns out to be particularly useful whenever a multibyte character |
| 2865 |
is used as delimiter in (one of) the files to compare. |
| 2866 |
As example consider the comparison between <samp>ledger1</samp>: |
| 2867 |
</p><div class="example"> |
| 2868 |
<pre class="example"> In Out |
| 2869 |
|
| 2870 |
Jan 1200.00€ 1000.00€ |
| 2871 |
Feb 800.40€ 650.00€ |
| 2872 |
Mar 1620.50€ 1500.00€ |
| 2873 |
Apr 760.00€ 900.00€ |
| 2874 |
|
| 2875 |
Total 4380.90€ 4050.00€ |
| 2876 |
|
| 2877 |
Difference: +330.90€ |
| 2878 |
</pre></div> |
| 2879 |
|
| 2880 |
<p>and <samp>ledger2</samp>: |
| 2881 |
</p><div class="example"> |
| 2882 |
<pre class="example"> In Out |
| 2883 |
|
| 2884 |
Jan 1100.00€ 1000.00€ |
| 2885 |
Feb 800.40€ 750.00€ |
| 2886 |
Mar 1620.50€ 1700.00€ |
| 2887 |
Apr 750.00€ 900.00€ |
| 2888 |
|
| 2889 |
Total 4270.90€ 4350.00€ |
| 2890 |
|
| 2891 |
Difference: -79.10€ |
| 2892 |
</pre></div> |
| 2893 |
|
| 2894 |
<p>Since the Euro symbol is attached to all values, |
| 2895 |
<code>numdiff</code> cannot compare them in the proper way |
| 2896 |
if it is run with the default field delimiters, as |
| 2897 |
the output of the command ‘<samp>numdiff ledger1 ledger2</samp>’ shows: |
| 2898 |
</p><div class="example"> |
| 2899 |
<pre class="example">---------------- |
| 2900 |
##3 #:2 <== 1200.00€ |
| 2901 |
##3 #:2 ==> 1100.00€ |
| 2902 |
@ |
| 2903 |
---------------- |
| 2904 |
##4 #:3 <== 650.00€ |
| 2905 |
##4 #:3 ==> 750.00€ |
| 2906 |
@ |
| 2907 |
---------------- |
| 2908 |
##5 #:3 <== 1500.00€ |
| 2909 |
##5 #:3 ==> 1700.00€ |
| 2910 |
@ |
| 2911 |
---------------- |
| 2912 |
##6 #:2 <== 760.00€ |
| 2913 |
##6 #:2 ==> 750.00€ |
| 2914 |
@ |
| 2915 |
---------------- |
| 2916 |
##8 #:2 <== 4380.90€ |
| 2917 |
##8 #:2 ==> 4270.90€ |
| 2918 |
@ |
| 2919 |
##8 #:3 <== 4050.00€ |
| 2920 |
##8 #:3 ==> 4350.00€ |
| 2921 |
@ |
| 2922 |
---------------- |
| 2923 |
##10 #:2 <== +330.90€ |
| 2924 |
##10 #:2 ==> -79.10€ |
| 2925 |
@ |
| 2926 |
|
| 2927 |
+++ File "ledger1" differs from file "ledger2" |
| 2928 |
</pre></div> |
| 2929 |
|
| 2930 |
<p>The trick to perform the comparison in the proper way consists |
| 2931 |
in specifying the € symbol as field delimiter, in addition |
| 2932 |
to blank, horizontal tabulation and newline. |
| 2933 |
If <samp>ledger1</samp> and <samp>ledger2</samp> are encoded in UTF-8, |
| 2934 |
this can be done by using the option <samp>-D</samp> with the argument |
| 2935 |
‘<samp>\xE2\x82\xAC \s \t \n</samp>’, since the hexadecimal representation |
| 2936 |
of € in UTF8 is given by the byte sequence 0xE2 0x82 0xAC. |
| 2937 |
On my PC the output of the command |
| 2938 |
‘<samp>numdiff -D '\xE2\x82\xAC \s \t \n' ledger1 ledger2</samp>’ |
| 2939 |
shows that with such a choice of the delimiters <code>numdiff</code> performs |
| 2940 |
indeed a numerical comparison of the values contained in the two files: |
| 2941 |
</p><div class="example"> |
| 2942 |
<pre class="example">---------------- |
| 2943 |
##3 #:2 <== 1200.00 |
| 2944 |
##3 #:2 ==> 1100.00 |
| 2945 |
Absolute error = 1.0000000000e+2, Relative error = 9.0909090909e-2 |
| 2946 |
---------------- |
| 2947 |
##4 #:3 <== 650.00 |
| 2948 |
##4 #:3 ==> 750.00 |
| 2949 |
Absolute error = 1.0000000000e+2, Relative error = 1.5384615385e-1 |
| 2950 |
---------------- |
| 2951 |
##5 #:3 <== 1500.00 |
| 2952 |
##5 #:3 ==> 1700.00 |
| 2953 |
Absolute error = 2.0000000000e+2, Relative error = 1.3333333333e-1 |
| 2954 |
---------------- |
| 2955 |
##6 #:2 <== 760.00 |
| 2956 |
##6 #:2 ==> 750.00 |
| 2957 |
Absolute error = 1.0000000000e+1, Relative error = 1.3333333333e-2 |
| 2958 |
---------------- |
| 2959 |
##8 #:2 <== 4380.90 |
| 2960 |
##8 #:2 ==> 4270.90 |
| 2961 |
Absolute error = 1.1000000000e+2, Relative error = 2.5755695521e-2 |
| 2962 |
##8 #:3 <== 4050.00 |
| 2963 |
##8 #:3 ==> 4350.00 |
| 2964 |
Absolute error = 3.0000000000e+2, Relative error = 7.4074074074e-2 |
| 2965 |
---------------- |
| 2966 |
##10 #:2 <== +330.90 |
| 2967 |
##10 #:2 ==> -79.10 |
| 2968 |
Absolute error = 4.1000000000e+2, Relative error = 5.1833122630e+0 |
| 2969 |
|
| 2970 |
+++ File "ledger1" differs from file "ledger2" |
| 2971 |
</pre></div> |
| 2972 |
|
| 2973 |
<p>If <samp>ledger1</samp> and <samp>ledger2</samp> had been saved using |
| 2974 |
a multi-byte encoding different from UTF-8, then the sequence |
| 2975 |
of bytes which corresponds to € in this other encoding should have been |
| 2976 |
passed to <samp>-D</samp>. |
| 2977 |
</p> |
| 2978 |
<p>As for <samp>-s</samp>, with <samp>-D</samp> you can specify different delimiters |
| 2979 |
for the two files to compare by means of the prefixes ‘<samp>1:</samp>’ and ‘<samp>2:</samp>’, |
| 2980 |
like in ‘<samp>numdiff -D '1:\t \n' -D '2: -- \s \n' first_file second_file</samp>’. |
| 2981 |
The recommendations about quoting the set of delimiters |
| 2982 |
are valid also in presence of a prefix. |
| 2983 |
Mind that, if you provide an explicit set of delimiters for just one of the |
| 2984 |
files to compare, <code>numdiff</code> uses the default field |
| 2985 |
delimiters <strong>blank</strong>, <strong>tab</strong> and <strong>newline</strong> |
| 2986 |
for the other file. |
| 2987 |
</p> |
| 2988 |
<p>If you run Numdiff with the option <samp>-B</samp> (<samp>--binary</samp>) |
| 2989 |
on files created under MSDog/MSWindoze, you should |
| 2990 |
always include the character ‘<samp>\r</samp>’ in the set of field delimiters. |
| 2991 |
</p> |
| 2992 |
<p>The option <samp>-s</samp> and <samp>-D</samp> can appear more than once |
| 2993 |
on the command line. In case of conflicts, <code>numdiff</code> |
| 2994 |
assumes as set of delimiters for a given file the one |
| 2995 |
specified last on the command line. |
| 2996 |
</p> |
| 2997 |
<p>By means of the option <samp>-#</samp> the user can set the number of digits |
| 2998 |
in the significands used in multiple precision arithmetic. |
| 2999 |
The default value is 35, the largest admissible value is 180. |
| 3000 |
If <code>numdiff</code> has been linked against the |
| 3001 |
GNU Multiple Precision Arithmetic Library (also called GNU MP), |
| 3002 |
then the precision it uses is typically higher |
| 3003 |
than the specified one. On my machine the actual value |
| 3004 |
of the precision is 20 if the user requests a value between 0 and 20, |
| 3005 |
30 if the user specifies a precision between 21 and 30, |
| 3006 |
40 for a user-specified value between 31 and 40, and so on. |
| 3007 |
Anyway, the actual precision is never less than |
| 3008 |
the one requested by the user. |
| 3009 |
</p> |
| 3010 |
<p>Take into account that an higher precision makes the |
| 3011 |
execution of <code>numdiff</code> slower. This is particularly |
| 3012 |
true if <code>numdiff</code> is not using the computational routines |
| 3013 |
from the GNU MP library and the files to compare contain a lot of numerical fields. |
| 3014 |
In addition, mind that <code>numdiff</code> truncates |
| 3015 |
the value of a numerical field if it has <i>too much</i> digits with respect |
| 3016 |
to the current precision. To be precise, denoted by |
| 3017 |
<var>P</var> the current value of the precision, the following |
| 3018 |
rules apply. |
| 3019 |
</p><ul> |
| 3020 |
<li> If <code>numdiff</code> has been built with |
| 3021 |
its own internal support for multiple precision arithmetic, then |
| 3022 |
<ul> |
| 3023 |
<li> if a number is written in ordinary decimal notation, <code>numdiff</code> |
| 3024 |
will consider, in addition to all digits of the integer part, only |
| 3025 |
the first <var>P</var> digits of the fractional part; |
| 3026 |
</li><li> if a value is written in scientific notation, then <code>numdiff</code> |
| 3027 |
will only consider the first <var>P</var> digits of the fractional part |
| 3028 |
of the mantissa. |
| 3029 |
</li></ul> |
| 3030 |
</li><li> If <code>numdiff</code> uses the routines from the GNU MP library |
| 3031 |
to perform its computations, the value of a numerical |
| 3032 |
field is first translated into scientific notation and then |
| 3033 |
only the first <var>P</var> digits of the fractional part |
| 3034 |
of the mantissa are considered. |
| 3035 |
</li></ul> |
| 3036 |
|
| 3037 |
<p>You can find out whether your local version of <code>numdiff</code> |
| 3038 |
is relying on GNU MP or not by executing the command ‘<samp>numdiff -v</samp>’. |
| 3039 |
If <code>numdiff</code> uses GNU MP, then this command will display |
| 3040 |
the following message or similar (possibly translated |
| 3041 |
into your mother language) among other information: |
| 3042 |
</p><div class="example"> |
| 3043 |
<pre class="example">The software has been linked against |
| 3044 |
the GNU Multiple Precision Arithmetic Library, |
| 3045 |
version number 4.2.4. |
| 3046 |
</pre></div> |
| 3047 |
|
| 3048 |
<p>If <code>numdiff</code> does not rely on GNU MP, then |
| 3049 |
the displayed message will be (up to translation into |
| 3050 |
your mother language) |
| 3051 |
</p><div class="example"> |
| 3052 |
<pre class="example">The software has been built with |
| 3053 |
its own internal support for multiple precision arithmetic. |
| 3054 |
</pre></div> |
| 3055 |
|
| 3056 |
<p>By means of the option <samp>-c</samp> the user can qualify |
| 3057 |
a string as a symbol or name for a currency. |
| 3058 |
The string passed as argument to this option is ignored |
| 3059 |
whenever it appears immediately before the first digit of a number. |
| 3060 |
In particular, the presence of this string does not prevent a |
| 3061 |
field from being considered of numeric type. By prefixing |
| 3062 |
the argument of <samp>-c</samp> with ‘<samp>1:</samp>’ or ‘<samp>2:</samp>’ |
| 3063 |
it is possible to set the currency name/symbol only |
| 3064 |
for one of the compared files, or to specify different |
| 3065 |
currency names for the two files. |
| 3066 |
As example we consider the files <samp>money1</samp>: |
| 3067 |
</p><pre class="verbatim"> Profits Expenses |
| 3068 |
|
| 3069 |
+$430.10 -$300.50 |
| 3070 |
+$750.20 -$550.02 |
| 3071 |
+$876.24 -$720.00 |
| 3072 |
|
| 3073 |
Totals $2056.54 -$1570.52 |
| 3074 |
</pre> |
| 3075 |
<p>and <samp>money2</samp>: |
| 3076 |
</p><pre class="verbatim"> Profits Expenses |
| 3077 |
|
| 3078 |
USD430.10 -USD300.50 |
| 3079 |
USD750.20 -USD550.02 |
| 3080 |
USD876.24 -USD720.15 |
| 3081 |
|
| 3082 |
Totals 2056.54 -1570.67 |
| 3083 |
</pre><p>To properly compare them, we have to tell <code>numdiff</code> |
| 3084 |
that ‘<samp>$</samp>’ and ‘<samp>USD</samp>’ are the currency symbols for |
| 3085 |
<samp>money1</samp> and <samp>money2</samp>, respectively. |
| 3086 |
This can be achieved by ‘<samp>-c 1:$</samp>’ and ‘<samp>-c 2:USD</samp>’. |
| 3087 |
The output of the command ‘<samp>numdiff -c 1:$ -c 2:USD money1 money2</samp>’ is |
| 3088 |
</p><div class="example"> |
| 3089 |
<pre class="example">---------------- |
| 3090 |
##5 #:2 <== -$720.00 |
| 3091 |
##5 #:2 ==> -USD720.15 |
| 3092 |
Absolute error = 1.5000000000e-1, Relative error = 2.0833333333e-4 |
| 3093 |
---------------- |
| 3094 |
##7 #:3 <== -$1570.52 |
| 3095 |
##7 #:3 ==> -1570.67 |
| 3096 |
Absolute error = 1.5000000000e-1, Relative error = 9.5509767466e-5 |
| 3097 |
|
| 3098 |
+++ File "money1" differs from file "money2" |
| 3099 |
</pre></div> |
| 3100 |
|
| 3101 |
<p>as it is reasonable to expect. |
| 3102 |
</p> |
| 3103 |
<p>The argument of <samp>-c</samp> may also be |
| 3104 |
a multi-byte string, in particular a multi-byte string encoded in UTF-8. |
| 3105 |
If your locale uses UTF-8 as encoding, you can write the argument directly |
| 3106 |
in this form. For instance, you can write ‘<samp>-c €</samp>’ |
| 3107 |
to specify as currency name the Euro symbol. |
| 3108 |
If your locale does not use UTF-8 as encoding, or UTF-8 is not |
| 3109 |
supported by your terminal, you may still write an |
| 3110 |
UTF-8 encoded string as a multi-byte string by specifying each single byte |
| 3111 |
of every (multi-byte) character. |
| 3112 |
To this purpose you can use the same octal and hexadecimal escape sequences |
| 3113 |
recognized by the options <samp>-s</samp> and <samp>-D</samp>, but then the argument |
| 3114 |
of <samp>-c</samp> has to be quoted to avoid the interpretation of the hexadecimal |
| 3115 |
escape sequences by the shell. |
| 3116 |
</p> |
| 3117 |
<p>For example, if the files to compare are encoded in UTF-8, |
| 3118 |
you can set € as currency name by |
| 3119 |
adding ‘<samp>-c '\xE2\x82\xAC'</samp>’ to the command line of |
| 3120 |
<code>numdiff</code>, since the hexadecimal representation |
| 3121 |
of € in UTF-8 is given by the sequence of bytes |
| 3122 |
0xE2 0x82 0xAC. |
| 3123 |
</p> |
| 3124 |
<p>To see this in practice, if <samp>euro1</samp> contains the text |
| 3125 |
</p><div class="example"> |
| 3126 |
<pre class="example"> Profits Expenses |
| 3127 |
|
| 3128 |
+€430.10 -€300.50 |
| 3129 |
+€750.20 -€550.02 |
| 3130 |
+€876.24 -€720.00 |
| 3131 |
</pre></div> |
| 3132 |
|
| 3133 |
<p>and <samp>euro2</samp> the text |
| 3134 |
</p><div class="example"> |
| 3135 |
<pre class="example"> Profits Expenses |
| 3136 |
|
| 3137 |
+€430.10 -€300.00 |
| 3138 |
+€750.20 -€550.02 |
| 3139 |
+€876.00 -€720.00 |
| 3140 |
</pre></div> |
| 3141 |
|
| 3142 |
<p>then the report of ‘<samp>numdiff -c '\xE2\x82\xAC' euro1 euro2</samp>’ is |
| 3143 |
</p><div class="example"> |
| 3144 |
<pre class="example">---------------- |
| 3145 |
##3 #:2 <== -€300.50 |
| 3146 |
##3 #:2 ==> -€300.00 |
| 3147 |
Absolute error = 5.0000000000e-1, Relative error = 1.6666666667e-3 |
| 3148 |
---------------- |
| 3149 |
##5 #:1 <== +€876.24 |
| 3150 |
##5 #:1 ==> +€876.00 |
| 3151 |
Absolute error = 2.4000000000e-1, Relative error = 2.7397260274e-4 |
| 3152 |
|
| 3153 |
+++ File "euro1" differs from file "euro2" |
| 3154 |
</pre></div> |
| 3155 |
|
| 3156 |
<p>Please consider that <samp>-c</samp> |
| 3157 |
is only provided to let <code>numdiff</code> regard |
| 3158 |
a field as numeric also in presence of a currency name |
| 3159 |
immediately before its first digit: <code>numdiff</code> |
| 3160 |
does not know anything about currencies and can not perform any |
| 3161 |
kind of conversion between them. |
| 3162 |
In addition, mind that the number after the currency name |
| 3163 |
can be written in any format, not only in financial notation. |
| 3164 |
<code>numdiff</code> can even cope with the currency name |
| 3165 |
when it appears in a complex number. For example, |
| 3166 |
with ‘<samp>-c EUR</samp>’ <code>numdiff</code> considers |
| 3167 |
<tt>+EUR12-EUR0.24i</tt> and <tt>+12-0.24i</tt> |
| 3168 |
as equal. |
| 3169 |
</p> |
| 3170 |
<p>The options <samp>-d</samp>, <samp>-t</samp>, <samp>-g</samp>, |
| 3171 |
<samp>-p</samp>, <samp>-n</samp>, <samp>-e</samp> and <samp>-i</samp> can be used |
| 3172 |
to instruct <code>numdiff</code> about the numeric formats used in the |
| 3173 |
files which it is going to compare. |
| 3174 |
Since the two files to compare do not have to adopt the same numeric format, |
| 3175 |
<code>numdiff</code> allows to specify different numeric formats for them. |
| 3176 |
Each of the options <samp>-d</samp>, <samp>-t</samp>, <samp>-g</samp>, |
| 3177 |
<samp>-p</samp>, <samp>-n</samp>, <samp>-e</samp>, and <samp>-i</samp> |
| 3178 |
can have as argument one or two (single-byte) characters, in particular |
| 3179 |
one or two digits if the option is <samp>-g</samp>. In the first case |
| 3180 |
the argument refers to both files to compare, in the second case |
| 3181 |
the first character is for the file specified |
| 3182 |
first on the command line, the second character for |
| 3183 |
the file specified last. |
| 3184 |
For instance, the option <samp>-d</samp> can be used to |
| 3185 |
tell <code>numdiff</code> which character(s) is(are) |
| 3186 |
used to indicate the decimal point in the two files to compare. |
| 3187 |
If you give the command |
| 3188 |
‘<samp>numdiff -d_ <var>file1</var> <var>file2</var></samp>’, |
| 3189 |
then <code>numdiff</code> will understand that both in <var>file1</var> and in <var>file2</var> |
| 3190 |
the character <strong>underscore</strong> (‘<samp>_</samp>’) is used in place |
| 3191 |
of the default one (‘<samp>.</samp>’) to indicate |
| 3192 |
the position of the decimal point in the numerical values. |
| 3193 |
But if the command is |
| 3194 |
‘<samp>numdiff -d_: <var>file1</var> <var>file2</var></samp>’, |
| 3195 |
then <code>numdiff</code> will understand that the decimal point |
| 3196 |
is indicated by the character <strong>underscore</strong> in <var>file1</var>, |
| 3197 |
and by <strong>colon</strong> (‘<samp>:</samp>’) in <var>file2</var>. |
| 3198 |
</p> |
| 3199 |
<p>If you omit to use one of the options |
| 3200 |
<samp>-d</samp>, <samp>-t</samp>, <samp>-g</samp>, |
| 3201 |
<samp>-p</samp>, <samp>-n</samp>, <samp>-e</samp>, and <samp>-i</samp>, then the corresponding |
| 3202 |
attribute will take its default value, see <a href="#Default-Numeric-Format">Default Numeric Format</a>. |
| 3203 |
</p> |
| 3204 |
<p>You should be careful whenever you use one or more of these options. |
| 3205 |
First, not all characters can be passed to them as arguments. |
| 3206 |
The arguments of the option <samp>-g</samp> must be digits, |
| 3207 |
the arguments of the options <samp>-d</samp> and <samp>-t</samp> must |
| 3208 |
be punctuation marks (punctuation marks are all the |
| 3209 |
characters of the ASCII set for which the standard C function |
| 3210 |
<code>ispunct</code> returns a non zero value), those ones |
| 3211 |
of the options <samp>-p</samp>, <samp>-n</samp>, <samp>-e</samp> and <samp>-i</samp> |
| 3212 |
must be graphical characters but digits (graphical characters |
| 3213 |
are all the characters of the ASCII set for which the standard C function |
| 3214 |
<code>isgraph</code> returns a non zero value). |
| 3215 |
</p> |
| 3216 |
<p>It is not possible to set the decimal point, the thousands separator, |
| 3217 |
the positive sign, the negative sign, the |
| 3218 |
prefix for decimal exponent or the |
| 3219 |
symbol of the imaginary unit in such a way that, for a same file, |
| 3220 |
two or more of these characters come out to be equal. |
| 3221 |
This rule also applies if you miss/omit to explicitly select |
| 3222 |
a symbol through the appropriate option. |
| 3223 |
For instance, the command |
| 3224 |
‘<samp>numdiff -d,. <var>file1</var> <var>file2</var></samp>’ |
| 3225 |
will make <code>numdiff</code> abnormally terminate after printing |
| 3226 |
the error message: |
| 3227 |
</p> |
| 3228 |
<div class="example"> |
| 3229 |
<pre class="example">The numeric format specified for the first file is illegal, |
| 3230 |
the following symbols should be all different |
| 3231 |
while two or more of them are actually equal: |
| 3232 |
|
| 3233 |
Decimal point = `,' |
| 3234 |
Thousands separator = `,' |
| 3235 |
Leading positive sign = `+' |
| 3236 |
Leading negative sign = `-' |
| 3237 |
Prefix for decimal exponent = `e' |
| 3238 |
Symbol used to denote the imaginary unit = `i' |
| 3239 |
</pre></div> |
| 3240 |
|
| 3241 |
<p>With the option <samp>-d</samp> we have told <code>numdiff</code> |
| 3242 |
that in the first file the decimal point is indicated by the character |
| 3243 |
<strong>comma</strong>, but at the same time we have not modified the character |
| 3244 |
in use to separate the groups of thousands, which has remained the |
| 3245 |
default one, i.e. <strong>comma</strong>, for both files to compare. |
| 3246 |
In this way we have implicitly told that in |
| 3247 |
<var>file1</var> the character <strong>comma</strong> represents both decimal point |
| 3248 |
and thousands separator. Since this is not reasonable, <code>numdiff</code> |
| 3249 |
refuses to work. |
| 3250 |
To avoid this problem it would be sufficient to |
| 3251 |
set explicitly the thousands separator |
| 3252 |
by means of the option <samp>-t</samp>: |
| 3253 |
‘<samp>numdiff -d,. -t., <var>file1</var> <var>file2</var></samp>’. |
| 3254 |
Of course, we assume here that the decimal point |
| 3255 |
and the thousands separator are represented in <var>file1</var> |
| 3256 |
by <strong>comma</strong> and <strong>dot</strong> respectively, in |
| 3257 |
<var>file2</var> by <strong>dot</strong> and <strong>comma</strong>. |
| 3258 |
</p> |
| 3259 |
<p>I strongly suggest you, whenever you write a file, to |
| 3260 |
avoid using the same symbol for two different things (like would be using |
| 3261 |
<strong>comma</strong> for both decimal point and thousands |
| 3262 |
separator), it is nonsense. |
| 3263 |
</p> |
| 3264 |
<p>At last, it is possible (but silly) to specify |
| 3265 |
as argument for the options <samp>-d</samp>, <samp>-t</samp>, <samp>-g</samp>, |
| 3266 |
<samp>-p</samp>, <samp>-n</samp>, <samp>-e</samp>, or <samp>-i</samp> |
| 3267 |
one of the characters used as delimiters in the files to compare. |
| 3268 |
<code>numdiff</code> does not complain, but you have |
| 3269 |
to consider that the program first uses the set of field delimiters |
| 3270 |
to split the files into fields and only afterwards, when it has to distinguish |
| 3271 |
between numerical and non-numerical fields, it takes |
| 3272 |
into account the numeric formats specified for the two files. |
| 3273 |
To prevent conflicts, you should then avoid to specify as argument for |
| 3274 |
the options <samp>-d</samp>, <samp>-t</samp>, <samp>-g</samp>, |
| 3275 |
<samp>-p</samp>, <samp>-n</samp>, <samp>-e</samp>, or <samp>-i</samp> a character |
| 3276 |
which is also used as field delimiter. |
| 3277 |
As a general rule, in writing a file you should avoid using the same symbol |
| 3278 |
to mean two different things. |
| 3279 |
What we have said also explains why the argument |
| 3280 |
of the option <samp>-c</samp> should never contain field delimiters. |
| 3281 |
</p> |
| 3282 |
<a name="Restriction-of-the-comparison-to-particular-fields"></a><p>The option <samp>-X</samp> can be used |
| 3283 |
to restrict the comparison between files to a certain |
| 3284 |
group of fields. |
| 3285 |
<a name="Use-of-the-option-_002dX"></a>This option requires as argument a range of positive integer values |
| 3286 |
or eventually just one positive integer number. The argument indicates |
| 3287 |
the position(s) of the fields that <code>numdiff</code> has to ignore. |
| 3288 |
Remember that the fields of a line are numerated starting |
| 3289 |
from the left hand of the line |
| 3290 |
and proceeding towards the right hand. |
| 3291 |
</p> |
| 3292 |
<p>The argument passed to <samp>-X</samp> can start with a prefix, |
| 3293 |
which must be either ‘<samp>1:</samp>’ or ‘<samp>2:</samp>’. |
| 3294 |
‘<samp>1:</samp>’ refers to the file passed as first on the command line, |
| 3295 |
‘<samp>2:</samp>’ to the file specified as second. |
| 3296 |
With the prefix ‘<samp>1:</samp>’ only the fields of the first file |
| 3297 |
corresponding to the specified position(s) are ignored. |
| 3298 |
Similarly, you have to use the prefix ‘<samp>2:</samp>’ |
| 3299 |
if you want to ignore only fields from the second file. |
| 3300 |
</p> |
| 3301 |
<p>The option <samp>-X</samp> can appear more times on the command line, |
| 3302 |
in which case <code>numdiff</code> will ignore all fields |
| 3303 |
located in the positions so specified. |
| 3304 |
Some examples can clarify the use of ranges and prefixes. |
| 3305 |
If the file <samp>List1</samp> contains the data |
| 3306 |
</p><pre class="verbatim">* a 1 1 1 1 |
| 3307 |
* b 2 2 2 2 |
| 3308 |
* c 3 3 3 3 |
| 3309 |
* d 4 4 4 4 |
| 3310 |
* e 5 5 5 5 |
| 3311 |
</pre> |
| 3312 |
<p>and <samp>List2</samp> the data |
| 3313 |
</p><pre class="verbatim"> 1 1.1 1.01 A 1.001 1.0001 |
| 3314 |
2 2.2 2.02 B 2.002 2.0002 |
| 3315 |
3 3.3 3.03 C 3.003 3.0003 |
| 3316 |
4 4.4 4.04 D 4.004 4.0004 |
| 3317 |
5 5.5 5.05 E 5.005 5.0005 |
| 3318 |
</pre> |
| 3319 |
<p>then the output of ‘<samp>numdiff -X 1:1-2 -X 2:4 -X 1:6 -X 2:5-6 List1 List2</samp>’ is |
| 3320 |
</p><div class="example"> |
| 3321 |
<pre class="example">---------------- |
| 3322 |
##1 #:4 <== 1 |
| 3323 |
##1 #:2 ==> 1.1 |
| 3324 |
@ Absolute error = 1.0000000000e-1, Relative error = 1.0000000000e-1 |
| 3325 |
##1 #:5 <== 1 |
| 3326 |
##1 #:3 ==> 1.01 |
| 3327 |
@ Absolute error = 1.0000000000e-2, Relative error = 1.0000000000e-2 |
| 3328 |
---------------- |
| 3329 |
##2 #:4 <== 2 |
| 3330 |
##2 #:2 ==> 2.2 |
| 3331 |
@ Absolute error = 2.0000000000e-1, Relative error = 1.0000000000e-1 |
| 3332 |
##2 #:5 <== 2 |
| 3333 |
##2 #:3 ==> 2.02 |
| 3334 |
@ Absolute error = 2.0000000000e-2, Relative error = 1.0000000000e-2 |
| 3335 |
---------------- |
| 3336 |
##3 #:4 <== 3 |
| 3337 |
##3 #:2 ==> 3.3 |
| 3338 |
@ Absolute error = 3.0000000000e-1, Relative error = 1.0000000000e-1 |
| 3339 |
##3 #:5 <== 3 |
| 3340 |
##3 #:3 ==> 3.03 |
| 3341 |
@ Absolute error = 3.0000000000e-2, Relative error = 1.0000000000e-2 |
| 3342 |
---------------- |
| 3343 |
##4 #:4 <== 4 |
| 3344 |
##4 #:2 ==> 4.4 |
| 3345 |
@ Absolute error = 4.0000000000e-1, Relative error = 1.0000000000e-1 |
| 3346 |
##4 #:5 <== 4 |
| 3347 |
##4 #:3 ==> 4.04 |
| 3348 |
@ Absolute error = 4.0000000000e-2, Relative error = 1.0000000000e-2 |
| 3349 |
---------------- |
| 3350 |
##5 #:4 <== 5 |
| 3351 |
##5 #:2 ==> 5.5 |
| 3352 |
@ Absolute error = 5.0000000000e-1, Relative error = 1.0000000000e-1 |
| 3353 |
##5 #:5 <== 5 |
| 3354 |
##5 #:3 ==> 5.05 |
| 3355 |
@ Absolute error = 5.0000000000e-2, Relative error = 1.0000000000e-2 |
| 3356 |
|
| 3357 |
+++ File "List1" differs from file "List2" |
| 3358 |
</pre></div> |
| 3359 |
|
| 3360 |
<p>Numdiff cuts off from <samp>List1</samp> the fields in the positions 1, 2 and 6 |
| 3361 |
and from <samp>List2</samp> the fields in the positions 4, 5 and 6. |
| 3362 |
In this way it compares the third, fourth and fifth field |
| 3363 |
of every line of |
| 3364 |
<samp>List1</samp> with the first, second and third field respectively |
| 3365 |
of the corresponding line of <samp>List2</samp>. |
| 3366 |
An equivalent form of the command |
| 3367 |
‘<samp>numdiff -X 1:1-2 -X 2:4 -X 1:6 -X 2:5-6 List1 List2</samp>’ |
| 3368 |
is given by |
| 3369 |
‘<samp>numdiff -X 1:1-2 -X 2:4-5 -X 6 List1 List2</samp>’ : |
| 3370 |
since the sixth field is cut off from both files, we can |
| 3371 |
refer to it without a prefix. |
| 3372 |
</p> |
| 3373 |
<p>As you can see, you can specify a range of fields |
| 3374 |
by using the notation ‘<samp><var>m</var>-<var>n</var></samp>’, |
| 3375 |
where <var>m</var> and <var>n</var> are the field numbers |
| 3376 |
of the first and of the last field in the range. |
| 3377 |
It is even possible to use range expressions like |
| 3378 |
‘<samp><var>m</var>-</samp>’ or ‘<samp>-<var>n</var></samp>’. The first |
| 3379 |
expression corresponds to all fields starting from |
| 3380 |
the <var>m</var>th one (inclusive) till to the end of line, |
| 3381 |
the second selects all fields from the first one |
| 3382 |
till to the <var>n</var>th one (inclusive). |
| 3383 |
Therefore the command |
| 3384 |
‘<samp>numdiff -X 1:1-2 -X 2:4 -X 1:6 -X 2:5-6 List1 List2</samp>’ |
| 3385 |
is equivalent to |
| 3386 |
‘<samp>numdiff -X 1:-2 -X 2:4 -X 1:6 -X 2:5- List1 List2</samp>’ |
| 3387 |
and to |
| 3388 |
‘<samp>numdiff -X 1:-2 -X 1:6 -X 2:4- List1 List2</samp>’. |
| 3389 |
</p> |
| 3390 |
<p>Mind that, while writing a specification for the option <samp>-X</samp>, |
| 3391 |
the largest field number you can use is 32768. |
| 3392 |
</p> |
| 3393 |
<p>If you employ the option <samp>-X</samp> the exit status of <code>numdiff</code> |
| 3394 |
reflects the outcome of the restricted comparison. |
| 3395 |
For instance, the exit status of ‘<samp>numdiff -X 8- <var>file1</var> <var>file2</var></samp>’ |
| 3396 |
is 1 only if <code>numdiff</code> has found a difference |
| 3397 |
in the first seven fields of <var>file1</var> and <var>file2</var>. |
| 3398 |
If the two files differ only in the fields after the seventh one, |
| 3399 |
then <code>numdiff</code> ends with a zero exit status. |
| 3400 |
</p> |
| 3401 |
<p>Going back to the example with <samp>List1</samp> and <samp>List2</samp>, |
| 3402 |
the output of |
| 3403 |
‘<samp>numdiff -X 1:1-2 -X 1:4- -X 2:2- List1 List2</samp>’ is |
| 3404 |
</p><div class="example"> |
| 3405 |
<pre class="example"> |
| 3406 |
+++ Files "List1" and "List2" are equal |
| 3407 |
</pre></div> |
| 3408 |
|
| 3409 |
<p>since every field of <samp>List1</samp> at position 3 is equal |
| 3410 |
to the first field in the corresponding line of <samp>List2</samp>. |
| 3411 |
The exit code returned by the program to the shell is in this case zero. |
| 3412 |
</p> |
| 3413 |
<p>The options <samp>-z</samp>, <samp>-Z</samp>, <samp>-m</samp>, <samp>-H</samp>, |
| 3414 |
<samp>-f</samp>, and <samp>-T</samp> influence the action of the filter |
| 3415 |
and their use is then described later, <a href="#Filtering">Filtering</a>. |
| 3416 |
Care that <samp>-z</samp> and <samp>-Z</samp> need both an argument in the same |
| 3417 |
form required by <samp>-X</samp>. |
| 3418 |
</p> |
| 3419 |
<p>Since version 5 Numdiff accepts also long options to conform to |
| 3420 |
the GNU standards. For example, now it is possible to use |
| 3421 |
‘<samp>--separators='\n\t %'</samp>’ or ‘<samp>--separators '\n\t %'</samp>’ |
| 3422 |
instead of using ‘<samp>-s '\n\t %'</samp>’. |
| 3423 |
</p> |
| 3424 |
<p>The long options, which start all with two dashes, |
| 3425 |
are listed at the beginning of this chapter, each one near to |
| 3426 |
the corresponding short option. |
| 3427 |
</p> |
| 3428 |
<p>The argument of a long option may or may not be preceded |
| 3429 |
by the <tt>=</tt> sign. The only exceptions are the options |
| 3430 |
<samp>--test-filter</samp> and <samp>--overview</samp>, |
| 3431 |
for which the presence of the <tt>=</tt> before the argument is mandatory. |
| 3432 |
Thus, ‘<samp>--test-filter=60</samp>’ is correct while |
| 3433 |
‘<samp>--test-filter 60</samp>’ is not accepted. |
| 3434 |
</p> |
| 3435 |
<hr> |
| 3436 |
<a name="ndselect"></a> |
| 3437 |
<div class="header"> |
| 3438 |
<p> |
| 3439 |
Next: <a href="#Invoking-ndselect" accesskey="n" rel="next">Invoking ndselect</a>, Previous: <a href="#Invoking-numdiff" accesskey="p" rel="prev">Invoking numdiff</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 3440 |
</div> |
| 3441 |
<a name="Selecting-lines-and-fields-for-the-comparison"></a> |
| 3442 |
<h2 class="chapter">6 Selecting lines and fields for the comparison</h2> |
| 3443 |
|
| 3444 |
<a name="index-ndselect-_0028introduction-to-its-use_0029"></a> |
| 3445 |
<a name="index-Tools"></a> |
| 3446 |
|
| 3447 |
<p>Together with the version 5.x of Numdiff is shipped the program <code>ndselect</code>. |
| 3448 |
Originally, I decided to create this utility in order to deal with a situation |
| 3449 |
that comes out often in Numerical Analysis. Here I present a very simple example of |
| 3450 |
such a situation. Let us suppose that file <samp>list1</samp> |
| 3451 |
contains the values of the square root, rounded to the 20th decimal digit, |
| 3452 |
for all integer numbers between 12 and 24: |
| 3453 |
</p><pre class="verbatim">12 3.46410161513775458705 |
| 3454 |
13 3.60555127546398929312 |
| 3455 |
14 3.74165738677394138558 |
| 3456 |
15 3.87298334620741688518 |
| 3457 |
16 4 |
| 3458 |
17 4.12310562561766054982 |
| 3459 |
18 4.24264068711928514641 |
| 3460 |
19 4.35889894354067355224 |
| 3461 |
20 4.47213595499957939282 |
| 3462 |
21 4.58257569495584000659 |
| 3463 |
22 4.69041575982342955457 |
| 3464 |
23 4.7958315233127195416 |
| 3465 |
24 4.89897948556635619639 |
| 3466 |
</pre> |
| 3467 |
<p>File <var>list2</var> contains <em>suitable</em> approximations of the square root |
| 3468 |
only for the numbers between 12 and 21 which are multiple of 3: |
| 3469 |
</p> |
| 3470 |
<pre class="verbatim">12 3.46410162002945508100 |
| 3471 |
15 3.87298387096774193548 |
| 3472 |
18 4.24264705882352941176 |
| 3473 |
21 4.58260869565217391304 |
| 3474 |
</pre> |
| 3475 |
<p>These approximations could have been obtained |
| 3476 |
by using the famous Heron’s algorithm: given an approximation |
| 3477 |
<code>a</code> for the square root of a number <code>x</code>, a better |
| 3478 |
approximation is computed by using the formula <code>a := 0.5 * (x/a + a)</code>. |
| 3479 |
What we want now is to understand by means of <code>numdiff</code> |
| 3480 |
how good the approximations contained in file <var>list2</var> are. |
| 3481 |
Unfortunately, we cannot execute directly the command |
| 3482 |
‘<samp>numdiff list1 list2</samp>’, since in this way we would compare |
| 3483 |
the approximations provided for the square roots of 15, 18, and 21 |
| 3484 |
with the square roots of 13, 14, and 15, respectively. |
| 3485 |
To make the comparison in the right way, |
| 3486 |
one could open <samp>list1</samp> in a text editor and remove from this file |
| 3487 |
all lines but the ones related to the numbers 12, 15, 18, and 21. |
| 3488 |
This approach is practicable since we have to remove only a few lines: |
| 3489 |
one can easily figure out how boring and inefficient would be to manually |
| 3490 |
remove hundreds or thousands of lines from a file. |
| 3491 |
</p> |
| 3492 |
<p>An expert GNU user would suggest that it is |
| 3493 |
possible to automate this removal by using the well known utilities |
| 3494 |
<code>head</code> and <code>sed</code>, in this particular case |
| 3495 |
‘<samp>head -n 10 list1 | sed -n -e '1~3 p' > List1</samp>’. |
| 3496 |
A quick explanation for the ones who do not know how to use <code>head</code> |
| 3497 |
and <code>sed</code>: the previous command extracts from |
| 3498 |
<samp>list1</samp> the first 10 lines, namely the lines containing the square roots |
| 3499 |
of the numbers from 12 to 21, then picks every third line starting |
| 3500 |
from the first one to select only the lines related to 12, 15, 18, and 21. |
| 3501 |
Finally, these lines are printed to the file <samp>List1</samp>, |
| 3502 |
which then looks like: |
| 3503 |
</p><pre class="verbatim">12 3.46410161513775458705 |
| 3504 |
15 3.87298334620741688518 |
| 3505 |
18 4.24264068711928514641 |
| 3506 |
21 4.58257569495584000659 |
| 3507 |
</pre> |
| 3508 |
<p>Once obtained <samp>List1</samp>, we can perform the comparison between |
| 3509 |
the values we are interested in by means of ‘<samp>numdiff List1 list2</samp>’ . |
| 3510 |
Unfortunately, this trick only works if you have installed the GNU version |
| 3511 |
of <code>sed</code> which, as far as I know, is the only one |
| 3512 |
providing the extension <var>first~step</var> to specify line addresses. |
| 3513 |
This is why I decided to implement <code>ndselect</code>, which allows to |
| 3514 |
obtain the same result as above with the simpler command |
| 3515 |
‘<samp>ndselect -b 1 -e 10 -s 3 list1 > List1</samp>’. |
| 3516 |
</p> |
| 3517 |
<p>The meaning of the arguments passed to the options <samp>-b</samp>, |
| 3518 |
<samp>-e</samp>, and <samp>-s</samp> is the following: we tell |
| 3519 |
<code>ndselect</code> to print every third line of file <samp>list1</samp> |
| 3520 |
(the option <samp>-s</samp> specifies the step) |
| 3521 |
starting from the first one (the option <samp>-b</samp> specifies the beginning) |
| 3522 |
and ending within the tenth one possibly inclusive |
| 3523 |
(the option <samp>-e</samp> specifies the end). |
| 3524 |
Because of the presence of the redirection operator <code>></code>, |
| 3525 |
the previous command sends to the file <samp>List1</samp> |
| 3526 |
what <code>ndselect</code> would print to the screen (standard output). |
| 3527 |
</p> |
| 3528 |
<p>Since version 5.6 <code>ndselect</code> can also be used to select |
| 3529 |
particular fields of a file. |
| 3530 |
Instead of printing all fields of every line, you may want to print |
| 3531 |
indeed only the fields at particular positions. |
| 3532 |
To do this you can employ the option <samp>-F</samp> to |
| 3533 |
indicate the position of the first field to print, |
| 3534 |
the option <samp>-L</samp> to indicate the position of the last field that |
| 3535 |
can be printed, the option <samp>-I</samp> to set the increment |
| 3536 |
when selecting the fields. In addition, the option <samp>-S</samp> |
| 3537 |
can be used to specify a set of field delimiters different from the |
| 3538 |
default one (which consists of <strong>blank</strong>, <strong>tab</strong> and |
| 3539 |
<strong>newline</strong>). As for <code>numdiff</code>, the field |
| 3540 |
delimiters are used to split the input lines into fields. |
| 3541 |
</p> |
| 3542 |
<p>The option <samp>-S</samp> of <code>ndselect</code> |
| 3543 |
recognizes and accepts the same escape sequences of |
| 3544 |
<code>numdiff</code> options <samp>-s</samp>, <samp>-D</samp>, and <samp>-c</samp>. |
| 3545 |
</p> |
| 3546 |
<p>As example consider the selection of the even fields between |
| 3547 |
the second and the sixth one inclusive from the file |
| 3548 |
<samp>many_many_columns</samp>, whose contents are shown here: |
| 3549 |
</p><pre class="verbatim">A | I | 1.1 | 1.08 | 1.01 | 0.1 | 11.011 | -1.0e-1 |
| 3550 |
B | II | 2.2 | 2.16 | 4.04 | 0.4 | 24.024 | -1.0e-2 |
| 3551 |
C | III | 3.3 | 3.24 | 9.09 | 0.9 | 39.039 | -1.0e-3 |
| 3552 |
D | IV | 4.4 | 4.32 | 16.16 | 1.6 | 416.039 | -1.0e-4 |
| 3553 |
E | V | 5.5 | 5.40 | 25.25 | 2.5 | 525.416 | -1.0e-5 |
| 3554 |
F | # | # | # | # | # | # | # |
| 3555 |
</pre> |
| 3556 |
<p>This selection can be accomplished by means of the command |
| 3557 |
‘<samp>ndselect -S '| \t\n' -F 2 -L 6 -I 2 many_many_columns</samp>’, whose |
| 3558 |
output shows only the selected fields: |
| 3559 |
</p><div class="example"> |
| 3560 |
<pre class="example">I | 1.08 | 0.1 |
| 3561 |
II | 2.16 | 0.4 |
| 3562 |
III | 3.24 | 0.9 |
| 3563 |
IV | 4.32 | 1.6 |
| 3564 |
V | 5.40 | 2.5 |
| 3565 |
# | # | # |
| 3566 |
</pre></div> |
| 3567 |
|
| 3568 |
<p>Of course, you can also select particular fields of particular lines, |
| 3569 |
as shown by the output of the command |
| 3570 |
‘<samp>ndselect -S '| \t\n' -b 1 -e 5 -s 3 -F 2 -L 6 -I 2 many_many_columns</samp>’: |
| 3571 |
</p><div class="example"> |
| 3572 |
<pre class="example">I | 1.08 | 0.1 |
| 3573 |
IV | 4.32 | 1.6 |
| 3574 |
</pre></div> |
| 3575 |
|
| 3576 |
<p>By default, <code>ndselect</code> reuses the delimiters found in the input |
| 3577 |
lines while writing the selected fields to the standard output. |
| 3578 |
You can specify a custom separator by means of the option <samp>-O</samp>. |
| 3579 |
This one recognizes and accepts the same escape sequences of |
| 3580 |
<code>numdiff</code> options <samp>-s</samp>, <samp>-D</samp>, and <samp>-c</samp>. |
| 3581 |
For example, |
| 3582 |
‘<samp>ndselect -S '| \t\n' -b 1 -e 5 -s 3 -F 2 -L 6 -I 2 -O '\t\t' many_many_columns</samp>’ |
| 3583 |
puts two horizontal tabulations after every printed field: |
| 3584 |
</p><pre class="verbatim">I 1.08 0.1 |
| 3585 |
IV 4.32 1.6 |
| 3586 |
</pre> |
| 3587 |
<p>Even if the implementation of a filter in <code>numdiff</code> and the addition |
| 3588 |
of the option <samp>-X</samp> have made <code>ndselect</code> much less useful than |
| 3589 |
in the past, this tool can still be used to handle some special cases. |
| 3590 |
In addition, it can be used as a filter for other programs than <code>numdiff</code>. |
| 3591 |
The complete synopsis of <code>ndselect</code> can be found in the |
| 3592 |
next chapter. |
| 3593 |
</p> |
| 3594 |
<hr> |
| 3595 |
<a name="Invoking-ndselect"></a> |
| 3596 |
<div class="header"> |
| 3597 |
<p> |
| 3598 |
Next: <a href="#Filtering" accesskey="n" rel="next">Filtering</a>, Previous: <a href="#ndselect" accesskey="p" rel="prev">ndselect</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 3599 |
</div> |
| 3600 |
<a name="Invoking-ndselect-1"></a> |
| 3601 |
<h2 class="chapter">7 Invoking ndselect</h2> |
| 3602 |
|
| 3603 |
<a name="index-Invoking-ndselect"></a> |
| 3604 |
<a name="index-Options_002c-command-line-_0028ndselect_0029"></a> |
| 3605 |
<a name="index-Command-line-options-for-ndselect"></a> |
| 3606 |
<a name="index-Synopsis-_0028ndselect_0029"></a> |
| 3607 |
<a name="index-Diagnostics-_0028ndselect_0029"></a> |
| 3608 |
|
| 3609 |
<p><strong>SYNOPSIS</strong> |
| 3610 |
</p> |
| 3611 |
<div class="example"> |
| 3612 |
<pre class="example"> ndselect -h|--help|-v|--version |
| 3613 |
</pre></div> |
| 3614 |
<p>or |
| 3615 |
</p><div class="example"> |
| 3616 |
<pre class="example"> ndselect [-b <var>N</var>][-e <var>N</var>][-s <var>N</var>][-F <var>N</var>][-L <var>N</var>][-I <var>N</var>][-S <var>IFS</var>][-D <var>DELIMS</var>] |
| 3617 |
[-O <var>OSEP</var>][-x][-l <var>PATH</var>][-o <var>PATH</var>][<var>FILE</var>] |
| 3618 |
</pre></div> |
| 3619 |
|
| 3620 |
<p>where <var>FILE</var> is the name of the file to read from. |
| 3621 |
</p> |
| 3622 |
<p>In the first case <code>ndselect</code> prints a |
| 3623 |
short help or/and version number, Copyright, License notice, |
| 3624 |
and NO-Warranty disclaimer. |
| 3625 |
In the second case <code>ndselect</code> prints to the standard output |
| 3626 |
a subset of lines and fields from <var>FILE</var>. |
| 3627 |
The complete path of <var>FILE</var> should be given, |
| 3628 |
a directory name is not accepted. |
| 3629 |
If no input file is specified, the program reads from the standard input. |
| 3630 |
</p> |
| 3631 |
<p><strong>OPTIONS</strong> |
| 3632 |
</p> |
| 3633 |
<dl compact="compact"> |
| 3634 |
<dt><samp>-b, --beginning, --start=<var>N</var></samp></dt> |
| 3635 |
<dd><p>Set to <var>N</var> the number of the first line to print |
| 3636 |
(The default behavior is to start with line number 1) |
| 3637 |
</p> |
| 3638 |
</dd> |
| 3639 |
<dt><samp>-e, --end=<var>N</var></samp></dt> |
| 3640 |
<dd><p>Set to <var>N</var> the number of the last line that can be printed |
| 3641 |
(The default behavior is to arrive till to the end of the file) |
| 3642 |
</p> |
| 3643 |
</dd> |
| 3644 |
<dt><samp>-s, --step=<var>N</var></samp></dt> |
| 3645 |
<dd><p>Set to <var>N</var> the increment to use when selecting the lines to print |
| 3646 |
(The default value for the increment is 1) |
| 3647 |
</p> |
| 3648 |
</dd> |
| 3649 |
<dt><samp>-F, --first-field=<var>N</var></samp></dt> |
| 3650 |
<dd><p>Set to <var>N</var> the number of the first field to print |
| 3651 |
(The default behavior is to start with field number 1) |
| 3652 |
</p> |
| 3653 |
</dd> |
| 3654 |
<dt><samp>-L, --last-field=<var>N</var></samp></dt> |
| 3655 |
<dd><p>Set to <var>N</var> the number of the last field that can be printed |
| 3656 |
(The default behavior is to arrive till to the end of every line) |
| 3657 |
</p> |
| 3658 |
</dd> |
| 3659 |
<dt><samp>-I, --increment=<var>N</var></samp></dt> |
| 3660 |
<dd><p>Set to <var>N</var> the increment to use when selecting the fields to print |
| 3661 |
(The default value for the increment is 1) |
| 3662 |
</p> |
| 3663 |
</dd> |
| 3664 |
<dt><samp>-S, --separators=<var>IFS</var></samp></dt> |
| 3665 |
<dd><p>Specify the set of characters to use as delimiters |
| 3666 |
while splitting the input lines into fields |
| 3667 |
(The default set of delimiters is space, tab and newline) |
| 3668 |
</p> |
| 3669 |
</dd> |
| 3670 |
<dt><samp>-D, --delimiters=<var>DELIMS</var></samp></dt> |
| 3671 |
<dd><p>Specify the set of strings to use as delimiters |
| 3672 |
while splitting the input lines into fields |
| 3673 |
(The default set of delimiters is space, tab and newline) |
| 3674 |
</p> |
| 3675 |
</dd> |
| 3676 |
<dt><samp>-O, --output-separator=<var>OSEP</var></samp></dt> |
| 3677 |
<dd><p>Specify the string to use as separator |
| 3678 |
while writing the selected fields to the standard output |
| 3679 |
(The default behavior consists in reusing the delimiters found in the input lines) |
| 3680 |
</p> |
| 3681 |
</dd> |
| 3682 |
<dt><samp>-x, --omit-empty-lines</samp></dt> |
| 3683 |
<dd><p>Do not print empty lines |
| 3684 |
</p> |
| 3685 |
</dd> |
| 3686 |
<dt><samp>-l, --warnings-to=<var>PATH</var></samp></dt> |
| 3687 |
<dd><p>Redirect warning and error messages from stderr |
| 3688 |
to the indicated file |
| 3689 |
</p> |
| 3690 |
</dd> |
| 3691 |
<dt><samp>-o, --output=<var>PATH</var></samp></dt> |
| 3692 |
<dd><p>Redirect output from stdout to the indicated file |
| 3693 |
</p> |
| 3694 |
</dd> |
| 3695 |
<dt><samp>-h, --help</samp></dt> |
| 3696 |
<dd><p>Show this help message |
| 3697 |
</p> |
| 3698 |
</dd> |
| 3699 |
<dt><samp>-v, --version</samp></dt> |
| 3700 |
<dd><p>Show version number, Copyright, Distribution Terms and NO-Warranty |
| 3701 |
</p></dd> |
| 3702 |
</dl> |
| 3703 |
|
| 3704 |
<p>Passing 0 as argument to the option <samp>-L</samp> or to <samp>-e</samp> |
| 3705 |
is equivalent to omit this option and leave enabled the default behavior |
| 3706 |
(which consists in scanning till to the end of the line and of |
| 3707 |
the file, respectively). |
| 3708 |
</p> |
| 3709 |
<p><strong>DIAGNOSTICS</strong> |
| 3710 |
</p> |
| 3711 |
<p>The exit status is 0 in case of normal termination, |
| 3712 |
-1 (255) in case of error. |
| 3713 |
</p> |
| 3714 |
<p>As <code>numdiff</code> does, since version 5 also <code>ndselect</code> |
| 3715 |
accepts long options. Thus, instead of ‘<samp>ndselect -b 1 -e 10 -s 3 list1 > List1</samp>’ |
| 3716 |
you can write ‘<samp>ndselect --start=1 --end=10 --step=3 list1 > List1</samp>’. |
| 3717 |
</p> |
| 3718 |
<p>The usage of the option <samp>-D</samp> is the same as for <code>numdiff</code>. |
| 3719 |
The option <samp>-S</samp> corresponds to the option <samp>-s</samp> of <code>numdiff</code>. |
| 3720 |
</p> |
| 3721 |
<hr> |
| 3722 |
<a name="Filtering"></a> |
| 3723 |
<div class="header"> |
| 3724 |
<p> |
| 3725 |
Next: <a href="#Warnings" accesskey="n" rel="next">Warnings</a>, Previous: <a href="#Invoking-ndselect" accesskey="p" rel="prev">Invoking ndselect</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 3726 |
</div> |
| 3727 |
<a name="Using-the-filter-of-numdiff"></a> |
| 3728 |
<h2 class="chapter">8 Using the filter of numdiff</h2> |
| 3729 |
|
| 3730 |
<a name="index-Filter"></a> |
| 3731 |
|
| 3732 |
<p>Since version 5 you can activate a filter |
| 3733 |
when launching <code>numdiff</code> to make the program appropriately compare |
| 3734 |
the given files even if they do not have the same structure. |
| 3735 |
Recalling the example of chapter 6, |
| 3736 |
if you run the command <code>numdiff -z 2- -V list1 list2</code> |
| 3737 |
you obtain the following result: |
| 3738 |
</p><div class="example"> |
| 3739 |
<pre class="example"> |
| 3740 |
---------------- |
| 3741 |
##1 <== 12 3.46410161513775458705 |
| 3742 |
##1 ==> 12 3.46410162002945508100 |
| 3743 |
|
| 3744 |
##1 #:2 <== 3.46410161513775458705 |
| 3745 |
##1 #:2 ==> 3.46410162002945508100 |
| 3746 |
Absolute error = 4.8917004940e-9, Relative error = 1.4121122985e-9 |
| 3747 |
---------------- |
| 3748 |
##2 <== 13 3.60555127546398929312 |
| 3749 |
==> |
| 3750 |
|
| 3751 |
---------------- |
| 3752 |
##3 <== 14 3.74165738677394138558 |
| 3753 |
==> |
| 3754 |
|
| 3755 |
---------------- |
| 3756 |
##4 <== 15 3.87298334620741688518 |
| 3757 |
##2 ==> 15 3.87298387096774193548 |
| 3758 |
|
| 3759 |
##4 #:2 <== 3.87298334620741688518 |
| 3760 |
##2 #:2 ==> 3.87298387096774193548 |
| 3761 |
Absolute error = 5.2476032505e-7, Relative error = 1.3549253331e-7 |
| 3762 |
---------------- |
| 3763 |
##5 <== 16 4 |
| 3764 |
==> |
| 3765 |
|
| 3766 |
---------------- |
| 3767 |
##6 <== 17 4.12310562561766054982 |
| 3768 |
==> |
| 3769 |
|
| 3770 |
---------------- |
| 3771 |
##7 <== 18 4.24264068711928514641 |
| 3772 |
##3 ==> 18 4.24264705882352941176 |
| 3773 |
|
| 3774 |
##7 #:2 <== 4.24264068711928514641 |
| 3775 |
##3 #:2 ==> 4.24264705882352941176 |
| 3776 |
Absolute error = 6.3717042443e-6, Relative error = 1.5018250929e-6 |
| 3777 |
---------------- |
| 3778 |
##8 <== 19 4.35889894354067355224 |
| 3779 |
==> |
| 3780 |
|
| 3781 |
---------------- |
| 3782 |
##9 <== 20 4.47213595499957939282 |
| 3783 |
==> |
| 3784 |
|
| 3785 |
---------------- |
| 3786 |
##10 <== 21 4.58257569495584000659 |
| 3787 |
##4 ==> 21 4.58260869565217391304 |
| 3788 |
|
| 3789 |
##10 #:2 <== 4.58257569495584000659 |
| 3790 |
##4 #:2 ==> 4.58260869565217391304 |
| 3791 |
Absolute error = 3.3000696334e-5, Relative error = 7.2013423303e-6 |
| 3792 |
---------------- |
| 3793 |
##11 <== 22 4.69041575982342955457 |
| 3794 |
==> |
| 3795 |
|
| 3796 |
---------------- |
| 3797 |
##12 <== 23 4.7958315233127195416 |
| 3798 |
==> |
| 3799 |
|
| 3800 |
---------------- |
| 3801 |
##13 <== 24 4.89897948556635619639 |
| 3802 |
==> |
| 3803 |
|
| 3804 |
|
| 3805 |
+++ File "list1" differs from file "list2" |
| 3806 |
</pre></div> |
| 3807 |
|
| 3808 |
<p>Numdiff has recognized that the lines of <samp>list1</samp> |
| 3809 |
with the square roots for the numbers |
| 3810 |
13, 14, 16, 17, 19, 20, 22, 23, and 24 |
| 3811 |
have been deleted from <samp>list2</samp>. |
| 3812 |
The numerical comparison has been done by coupling each line of <samp>list2</samp> |
| 3813 |
with the line of <samp>list1</samp> which displays the square root for the same |
| 3814 |
integer value. The output obtained running |
| 3815 |
the filter of Numdiff via <code>numdiff -f -z 2- list1 list2</code> |
| 3816 |
confirms this: |
| 3817 |
</p><div class="example"> |
| 3818 |
<pre class="example">12 3.46410161513775458705 12 3.46410162002945508100 |
| 3819 |
13 3.60555127546398929312 < |
| 3820 |
14 3.74165738677394138558 < |
| 3821 |
15 3.87298334620741688518 15 3.87298387096774193548 |
| 3822 |
16 4 < |
| 3823 |
17 4.12310562561766054982 < |
| 3824 |
18 4.24264068711928514641 18 4.24264705882352941176 |
| 3825 |
19 4.35889894354067355224 < |
| 3826 |
20 4.47213595499957939282 < |
| 3827 |
21 4.58257569495584000659 21 4.58260869565217391304 |
| 3828 |
22 4.69041575982342955457 < |
| 3829 |
23 4.7958315233127195416 < |
| 3830 |
24 4.89897948556635619639 < |
| 3831 |
|
| 3832 |
|
| 3833 |
+++ File "list1" differs from file "list2" |
| 3834 |
</pre></div> |
| 3835 |
|
| 3836 |
<p>If you compare the command |
| 3837 |
<code>numdiff -z 2- -V list1 list2</code> with the one |
| 3838 |
used for the files <samp>bill1</samp> and |
| 3839 |
<samp>bill2</samp>, see <a href="#command">command</a>, you surely notice that the filter |
| 3840 |
has been invoked in different ways, first |
| 3841 |
with <samp>-z @</samp> and then with <samp>-z 2-</samp>. |
| 3842 |
</p> |
| 3843 |
<p>The <i>synchronization</i> procedure used by the filter |
| 3844 |
is based on <i>blurring</i> and byte-by-byte comparison. |
| 3845 |
The options <samp>-z</samp> and <samp>-Z</samp> are used |
| 3846 |
to select which fields from which file have to |
| 3847 |
be blurred. They take both an argument in the |
| 3848 |
same form requested by <samp>-X</samp>, see <a href="#Use-of-the-option-_002dX">Use of the option -X</a>, |
| 3849 |
but accept additionally the special value ‘<samp>@</samp>’ |
| 3850 |
as abbreviation for the range of fields ‘<samp>1-</samp>’. |
| 3851 |
Thus, the specifications ‘<samp>1:@</samp>’, ‘<samp>2:@</samp>’ and ‘<samp>@</samp>’ |
| 3852 |
are used to mean all fields of the first file, |
| 3853 |
of the second one or of both, respectively. |
| 3854 |
</p> |
| 3855 |
<p>Employing <samp>-z</samp> and <samp>-Z</samp> in the right way |
| 3856 |
is extremely important to let the filter work as desired. |
| 3857 |
For instance, <code>numdiff -f -z @ list1 list2</code> |
| 3858 |
matches the lines of <samp>list1</samp> and <samp>list2</samp> |
| 3859 |
in the same wrong way |
| 3860 |
</p><div class="example"> |
| 3861 |
<pre class="example">12 3.46410161513775458705 12 3.46410162002945508100 |
| 3862 |
13 3.60555127546398929312 15 3.87298387096774193548 |
| 3863 |
14 3.74165738677394138558 18 4.24264705882352941176 |
| 3864 |
15 3.87298334620741688518 21 4.58260869565217391304 |
| 3865 |
16 4 < |
| 3866 |
17 4.12310562561766054982 < |
| 3867 |
18 4.24264068711928514641 < |
| 3868 |
19 4.35889894354067355224 < |
| 3869 |
20 4.47213595499957939282 < |
| 3870 |
21 4.58257569495584000659 < |
| 3871 |
22 4.69041575982342955457 < |
| 3872 |
23 4.7958315233127195416 < |
| 3873 |
24 4.89897948556635619639 < |
| 3874 |
|
| 3875 |
|
| 3876 |
+++ File "list1" differs from file "list2" |
| 3877 |
</pre></div> |
| 3878 |
|
| 3879 |
<p>as Numdiff would do without employing the filter. |
| 3880 |
</p> |
| 3881 |
<p>It is essential then to understand what <i>blurring a field</i> means |
| 3882 |
and how the filter uses blurring to match the lines |
| 3883 |
of the files to compare. |
| 3884 |
</p> |
| 3885 |
<p>After reading the files the filter removes from each of them |
| 3886 |
(from their images in the memory, actually) |
| 3887 |
all the fields selected by the option |
| 3888 |
<samp>-X</samp>, then it replaces each of the fields that |
| 3889 |
have to be blurred by a special character. |
| 3890 |
This special character is the same for both files |
| 3891 |
and it is so chosen that it cannot appear in |
| 3892 |
the text. Blurring a field means to replace |
| 3893 |
it by this sort of <i>place card</i>. |
| 3894 |
</p> |
| 3895 |
<p>After doing this, the filter converts all remaining numerical |
| 3896 |
fields to a standard format and then compares |
| 3897 |
the files byte by byte neglecting the field delimiters. |
| 3898 |
This comparison is just used to establish which |
| 3899 |
lines of the first file are not present in the second, |
| 3900 |
which lines of the second file are missing in the first one, |
| 3901 |
and how to match the remaining lines to create |
| 3902 |
a one-to-one correspondence. |
| 3903 |
</p> |
| 3904 |
<p>Only at this point <code>numdiff</code> inspects each couple of corresponding lines, |
| 3905 |
splits the two lines into the constituent fields, and |
| 3906 |
neglecting those ones eventually specified through the option <samp>-X</samp> |
| 3907 |
compares corresponding fields as it is supposed to do, performing |
| 3908 |
a numerical comparison whenever the fields are both legal numerical values. |
| 3909 |
</p> |
| 3910 |
<p>Blurring the right fields is essential to appropriately match the lines |
| 3911 |
from the two files before doing any numerical comparison. |
| 3912 |
Without blurring, the numerical fields could prevent the filter of |
| 3913 |
<code>numdiff</code> from an appropriate matching of the lines |
| 3914 |
by creating confusion with their (maybe small) numeric differences. |
| 3915 |
</p> |
| 3916 |
<p>Blurring can be of two types, conditional or unconditional. |
| 3917 |
The blurring is conditional if it has to be performed only for fields |
| 3918 |
which turn out to be legal numerical values. |
| 3919 |
The arguments of the option <samp>-z</samp> indicate which |
| 3920 |
fields of which file have to be blurred <strong>under the condition that |
| 3921 |
they are recognized as numeric fields</strong>. Non-numeric fields |
| 3922 |
are left by <samp>-z</samp> untouched (no blurring occurs for them). |
| 3923 |
Then ‘<samp>-z 1:5-7</samp>’ makes the filter blur the 5th, 6th and 7th field of each |
| 3924 |
line of the first file whenever they are recognized as numeric. |
| 3925 |
</p> |
| 3926 |
<p>By means of the option <samp>-Z</samp> you can specify which |
| 3927 |
fields have to be unconditionally blurred, i.e. |
| 3928 |
independently of their type, numeric or not. |
| 3929 |
For example, ‘<samp>-Z 2:3-4</samp>’ activates the blurring of the 3th and 4th field of each |
| 3930 |
line of the second file. |
| 3931 |
</p> |
| 3932 |
<p>Going back to the comparison of the files <samp>list1</samp> and <samp>list2</samp>, |
| 3933 |
the option ‘<samp>-z 2-</samp>’ of the command ‘<samp>numdiff -z 2- -V list1 list2</samp>’ |
| 3934 |
makes the filter transform the (memory copies of the) |
| 3935 |
two files as |
| 3936 |
</p><div class="example"> |
| 3937 |
<pre class="example">12 • |
| 3938 |
13 • |
| 3939 |
14 • |
| 3940 |
15 • |
| 3941 |
16 • |
| 3942 |
17 • |
| 3943 |
18 • |
| 3944 |
19 • |
| 3945 |
20 • |
| 3946 |
21 • |
| 3947 |
22 • |
| 3948 |
23 • |
| 3949 |
24 • |
| 3950 |
</pre></div> |
| 3951 |
|
| 3952 |
<p>and |
| 3953 |
</p> |
| 3954 |
<div class="example"> |
| 3955 |
<pre class="example">12 • |
| 3956 |
15 • |
| 3957 |
18 • |
| 3958 |
21 • |
| 3959 |
</pre></div> |
| 3960 |
|
| 3961 |
<p>respectively. Here • denotes the special |
| 3962 |
symbol used by the filter in the blurring procedure, even if this |
| 3963 |
symbol is not actually a bullet. |
| 3964 |
Since in this example space, tab and newline are |
| 3965 |
used as field delimiters, the byte-by-byte comparison between |
| 3966 |
the transformed files produces the same result displayed by the command |
| 3967 |
‘<samp>sdiff -W</samp>’ when applied to them: |
| 3968 |
</p> |
| 3969 |
<div class="example"> |
| 3970 |
<pre class="example">12 • 12 • |
| 3971 |
13 • < |
| 3972 |
14 • < |
| 3973 |
15 • 15 • |
| 3974 |
16 • < |
| 3975 |
17 • < |
| 3976 |
18 • 18 • |
| 3977 |
19 • < |
| 3978 |
20 • < |
| 3979 |
21 • 21 • |
| 3980 |
22 • < |
| 3981 |
23 • < |
| 3982 |
24 • < |
| 3983 |
</pre></div> |
| 3984 |
|
| 3985 |
<p>If you put the blurred fields back you obtain exactly the output |
| 3986 |
of ‘<samp>numdiff -f -z 2- list1 list2</samp>’, i.e. the outcome of the filtering: |
| 3987 |
</p> |
| 3988 |
<div class="example"> |
| 3989 |
<pre class="example">12 3.46410161513775458705 12 3.46410162002945508100 |
| 3990 |
13 3.60555127546398929312 < |
| 3991 |
14 3.74165738677394138558 < |
| 3992 |
15 3.87298334620741688518 15 3.87298387096774193548 |
| 3993 |
16 4 < |
| 3994 |
17 4.12310562561766054982 < |
| 3995 |
18 4.24264068711928514641 18 4.24264705882352941176 |
| 3996 |
19 4.35889894354067355224 < |
| 3997 |
20 4.47213595499957939282 < |
| 3998 |
21 4.58257569495584000659 21 4.58260869565217391304 |
| 3999 |
22 4.69041575982342955457 < |
| 4000 |
23 4.7958315233127195416 < |
| 4001 |
24 4.89897948556635619639 < |
| 4002 |
|
| 4003 |
|
| 4004 |
+++ File "list1" differs from file "list2" |
| 4005 |
|
| 4006 |
</pre></div> |
| 4007 |
|
| 4008 |
<p>Since the second field is a numerical value in all lines |
| 4009 |
of <samp>list1</samp> and <samp>list2</samp>, using the option <samp>-Z</samp> |
| 4010 |
instead of <samp>-z</samp> makes no difference in this case. |
| 4011 |
The output of ‘<samp>numdiff -f -Z 2- list1 list2</samp>’ is then the |
| 4012 |
same of ‘<samp>numdiff -f -z 2- list1 list2</samp>’. |
| 4013 |
</p> |
| 4014 |
<p>After this explanation you should also understand why |
| 4015 |
‘<samp>numdiff -f -z @ list1 list2</samp>’ gives a wrong result. |
| 4016 |
Since also the first field is always a numerical value, |
| 4017 |
the option ‘<samp>-z @</samp>’ makes the filter transform the two |
| 4018 |
given files as |
| 4019 |
</p><div class="example"> |
| 4020 |
<pre class="example">• • |
| 4021 |
• • |
| 4022 |
• • |
| 4023 |
• • |
| 4024 |
• • |
| 4025 |
• • |
| 4026 |
• • |
| 4027 |
• • |
| 4028 |
• • |
| 4029 |
• • |
| 4030 |
• • |
| 4031 |
• • |
| 4032 |
• • |
| 4033 |
</pre></div> |
| 4034 |
|
| 4035 |
<p>and |
| 4036 |
</p> |
| 4037 |
<div class="example"> |
| 4038 |
<pre class="example">• • |
| 4039 |
• • |
| 4040 |
• • |
| 4041 |
• • |
| 4042 |
</pre></div> |
| 4043 |
|
| 4044 |
<p>respectively, making then impossible to match the lines in a reasonable way. |
| 4045 |
</p> |
| 4046 |
<p>We consider now a typical situation |
| 4047 |
in which it is better to use <samp>-Z</samp> in place of <samp>-z</samp>. |
| 4048 |
If file <samp>Table1</samp> contains |
| 4049 |
</p><pre class="verbatim">-6 2.449490 |
| 4050 |
-5 2.236068 |
| 4051 |
-4 2.000000 |
| 4052 |
-3 1.732051 |
| 4053 |
-2 1.414214 |
| 4054 |
-1 1.000000 |
| 4055 |
0 0 |
| 4056 |
- - - - - - - - - |
| 4057 |
1 1.000000 |
| 4058 |
2 1.414214 |
| 4059 |
3 1.732051 |
| 4060 |
4 2.000000 |
| 4061 |
- - - - - - - - - |
| 4062 |
5 2.236068 |
| 4063 |
6 2.449490 |
| 4064 |
7 2.645751 |
| 4065 |
- - - - - - - - - |
| 4066 |
8 2.828427 |
| 4067 |
9 3.000000 |
| 4068 |
10 3.162278 |
| 4069 |
11 3.316625 |
| 4070 |
12 3.464102 |
| 4071 |
- - - - - - - - - |
| 4072 |
- - - - - - - - - |
| 4073 |
13 3.605551 |
| 4074 |
14 3.741657 |
| 4075 |
</pre> |
| 4076 |
<p>and <samp>Table2</samp> contains |
| 4077 |
</p> |
| 4078 |
<pre class="verbatim">-6 Not_defined |
| 4079 |
-4 Not_defined |
| 4080 |
-2 Not_defined |
| 4081 |
0 0.000000 |
| 4082 |
2 1.414216 |
| 4083 |
4 2.000000 |
| 4084 |
6 2.449494 |
| 4085 |
8 2.828469 |
| 4086 |
10 3.162278 |
| 4087 |
12 3.464102 |
| 4088 |
14 3.741658 |
| 4089 |
********************END |
| 4090 |
</pre> |
| 4091 |
<p>then the output of ‘<samp>numdiff -z 1:2 -Z 2:2 -f Table1 Table2</samp>’ is |
| 4092 |
</p><div class="example"> |
| 4093 |
<pre class="example">-6 2.449490 -6 Not_defined |
| 4094 |
-5 2.236068 < |
| 4095 |
-4 2.000000 -4 Not_defined |
| 4096 |
-3 1.732051 < |
| 4097 |
-2 1.414214 -2 Not_defined |
| 4098 |
-1 1.000000 < |
| 4099 |
0 0 0 0.000000 |
| 4100 |
- - - - - - - - - < |
| 4101 |
1 1.000000 < |
| 4102 |
2 1.414214 2 1.414216 |
| 4103 |
3 1.732051 < |
| 4104 |
4 2.000000 4 2.000000 |
| 4105 |
- - - - - - - - - < |
| 4106 |
5 2.236068 < |
| 4107 |
6 2.449490 6 2.449494 |
| 4108 |
7 2.645751 < |
| 4109 |
- - - - - - - - - < |
| 4110 |
8 2.828427 8 2.828469 |
| 4111 |
9 3.000000 < |
| 4112 |
10 3.162278 10 3.162278 |
| 4113 |
11 3.316625 < |
| 4114 |
12 3.464102 12 3.464102 |
| 4115 |
- - - - - - - - - < |
| 4116 |
- - - - - - - - - < |
| 4117 |
13 3.605551 < |
| 4118 |
14 3.741657 14 3.741658 |
| 4119 |
> ********************END |
| 4120 |
|
| 4121 |
|
| 4122 |
+++ File "Table1" differs from file "Table2" |
| 4123 |
</pre></div> |
| 4124 |
|
| 4125 |
<p>which is exactly what is expected. |
| 4126 |
On the other hand the command ‘<samp>numdiff -z 2 -f Table1 Table2</samp>’ displays |
| 4127 |
</p><div class="example"> |
| 4128 |
<pre class="example">-6 2.449490 | -6 Not_defined |
| 4129 |
-5 2.236068 | -4 Not_defined |
| 4130 |
-4 2.000000 | -2 Not_defined |
| 4131 |
-3 1.732051 < |
| 4132 |
-2 1.414214 < |
| 4133 |
-1 1.000000 < |
| 4134 |
0 0 0 0.000000 |
| 4135 |
- - - - - - - - - < |
| 4136 |
1 1.000000 < |
| 4137 |
2 1.414214 2 1.414216 |
| 4138 |
3 1.732051 < |
| 4139 |
4 2.000000 4 2.000000 |
| 4140 |
- - - - - - - - - < |
| 4141 |
5 2.236068 < |
| 4142 |
6 2.449490 6 2.449494 |
| 4143 |
7 2.645751 < |
| 4144 |
- - - - - - - - - < |
| 4145 |
8 2.828427 8 2.828469 |
| 4146 |
9 3.000000 < |
| 4147 |
10 3.162278 10 3.162278 |
| 4148 |
11 3.316625 < |
| 4149 |
12 3.464102 12 3.464102 |
| 4150 |
- - - - - - - - - < |
| 4151 |
- - - - - - - - - < |
| 4152 |
13 3.605551 < |
| 4153 |
14 3.741657 14 3.741658 |
| 4154 |
> ********************END |
| 4155 |
|
| 4156 |
|
| 4157 |
+++ File "Table1" differs from file "Table2" |
| 4158 |
</pre></div> |
| 4159 |
|
| 4160 |
<p>which is partially wrong. |
| 4161 |
</p> |
| 4162 |
<p>Notice that in <samp>Table1</samp> you find (truncated to the sixth decimal digit) |
| 4163 |
the square roots of the absolute values of the integer numbers |
| 4164 |
between -6 and 20, plus some randomly added lines. |
| 4165 |
The file <samp>Table2</samp> contains approximations (obtained by Newton’s method) |
| 4166 |
of the square roots of the even numbers between -6 and 20. |
| 4167 |
Since the (real) square root is not defined for |
| 4168 |
negative numbers, the values corresponding to -6, -4 and -2 |
| 4169 |
are replaced by <tt>Not_defined</tt>. |
| 4170 |
</p> |
| 4171 |
<p>Since <tt>Not_defined</tt> is not a numeric value, |
| 4172 |
during the execution of the last command the filter |
| 4173 |
transforms <samp>Table1</samp> in this way |
| 4174 |
</p><div class="example"> |
| 4175 |
<pre class="example">-6 • |
| 4176 |
-5 • |
| 4177 |
-4 • |
| 4178 |
-3 • |
| 4179 |
-2 • |
| 4180 |
-1 • |
| 4181 |
0 • |
| 4182 |
- - - - - - - - - |
| 4183 |
1 • |
| 4184 |
2 • |
| 4185 |
3 • |
| 4186 |
4 • |
| 4187 |
- - - - - - - - - |
| 4188 |
5 • |
| 4189 |
6 • |
| 4190 |
7 • |
| 4191 |
- - - - - - - - - |
| 4192 |
8 • |
| 4193 |
9 • |
| 4194 |
10 • |
| 4195 |
11 • |
| 4196 |
12 • |
| 4197 |
- - - - - - - - - |
| 4198 |
- - - - - - - - - |
| 4199 |
13 • |
| 4200 |
14 • |
| 4201 |
</pre></div> |
| 4202 |
|
| 4203 |
<p>and <samp>Table2</samp> in this other way |
| 4204 |
</p> |
| 4205 |
<div class="example"> |
| 4206 |
<pre class="example">-6 Not_defined |
| 4207 |
-4 Not_defined |
| 4208 |
-2 Not_defined |
| 4209 |
0 • |
| 4210 |
2 • |
| 4211 |
4 • |
| 4212 |
6 • |
| 4213 |
8 • |
| 4214 |
10 • |
| 4215 |
12 • |
| 4216 |
14 • |
| 4217 |
********************END |
| 4218 |
</pre></div> |
| 4219 |
|
| 4220 |
<p>Unfortunately the first three lines are enough to |
| 4221 |
confuse the synchronization procedure of the filter, which is based on |
| 4222 |
a byte-by-byte comparison with exclusion of the field |
| 4223 |
delimiters, as explained before. |
| 4224 |
</p> |
| 4225 |
<p>You can check that this is definitely the case by |
| 4226 |
looking at the output of the command |
| 4227 |
‘<samp>sdiff -W</samp>’ on the transformed files, |
| 4228 |
which is |
| 4229 |
</p><div class="example"> |
| 4230 |
<pre class="example">-6 • | -6 Not_defined |
| 4231 |
-5 • | -4 Not_defined |
| 4232 |
-4 • | -2 Not_defined |
| 4233 |
-3 • < |
| 4234 |
-2 • < |
| 4235 |
-1 • < |
| 4236 |
0 • 0 • |
| 4237 |
- - - - - - - - - < |
| 4238 |
1 • < |
| 4239 |
2 • 2 • |
| 4240 |
3 • < |
| 4241 |
4 • 4 • |
| 4242 |
- - - - - - - - - < |
| 4243 |
5 • < |
| 4244 |
6 • 6 • |
| 4245 |
7 • < |
| 4246 |
- - - - - - - - - < |
| 4247 |
8 • 8 • |
| 4248 |
9 • < |
| 4249 |
10 • 10 • |
| 4250 |
11 • < |
| 4251 |
12 • 12 • |
| 4252 |
- - - - - - - - - < |
| 4253 |
- - - - - - - - - < |
| 4254 |
13 • < |
| 4255 |
14 • 14 • |
| 4256 |
> ********************END |
| 4257 |
</pre></div> |
| 4258 |
|
| 4259 |
<p>If we give the command ‘<samp>numdiff -z 1:2 -Z 2:2 -f Table1 Table2</samp>’ |
| 4260 |
instead of ‘<samp>numdiff -z 2 -f Table1 Table2</samp>’, |
| 4261 |
the second field of the lines of <samp>Table2</samp> is always |
| 4262 |
blurred. The filter transforms then |
| 4263 |
<samp>Table2</samp> into |
| 4264 |
</p><div class="example"> |
| 4265 |
<pre class="example">-6 • |
| 4266 |
-4 • |
| 4267 |
-2 • |
| 4268 |
0 • |
| 4269 |
2 • |
| 4270 |
4 • |
| 4271 |
6 • |
| 4272 |
8 • |
| 4273 |
10 • |
| 4274 |
12 • |
| 4275 |
14 • |
| 4276 |
********************END |
| 4277 |
</pre></div> |
| 4278 |
|
| 4279 |
<p>and <i>re-synchronizes</i> the files <samp>Table1</samp> and <samp>Table2</samp> |
| 4280 |
in the right way. |
| 4281 |
</p> |
| 4282 |
<p>Using the unconditional blurring is suggested in all cases |
| 4283 |
when a certain field, which you want to include |
| 4284 |
in the comparison (use <samp>-X</samp> to completely |
| 4285 |
neglect one or more fields), is of numeric type |
| 4286 |
in almost all lines of (one of) the given |
| 4287 |
files. This can be for instance the case when in some |
| 4288 |
lines the contents of the field are given by |
| 4289 |
a special numeric value, like <tt>Infinity</tt>, <tt>Inf</tt>, |
| 4290 |
<tt>+Inf</tt> or <tt>-Inf</tt>, |
| 4291 |
or by <tt>NaN</tt>, abbreviation for <i>Not a Number</i>. |
| 4292 |
</p> |
| 4293 |
<p>Concerning the numeric fields which are not blurred, |
| 4294 |
it is worth remarking that the filter is not confused by differences in the |
| 4295 |
numeric format. Before the byte-by-byte comparison, |
| 4296 |
numeric values are converted indeed to a standard format. |
| 4297 |
To offer an example of this, let us suppose that <samp>short1</samp> contains a list |
| 4298 |
of numbers with their logarithms |
| 4299 |
</p><pre class="verbatim">0.001 -3 |
| 4300 |
0.01 -2 |
| 4301 |
0.1 -1 |
| 4302 |
1 0 |
| 4303 |
1000 3 |
| 4304 |
1000000 6 |
| 4305 |
1000000000 9 |
| 4306 |
</pre> |
| 4307 |
<p>and <samp>short2</samp> the same list of numbers and logarithms, but |
| 4308 |
with differences in the numeric format: |
| 4309 |
</p><pre class="verbatim">****************** |
| 4310 |
0.0010000 -3 |
| 4311 |
.0100 -2 |
| 4312 |
0000.10 -1 |
| 4313 |
1. 0 |
| 4314 |
1,000.000 3 |
| 4315 |
1,000,000. 6 |
| 4316 |
1,000,000,000 9 |
| 4317 |
</pre> |
| 4318 |
<p>Then ‘<samp>numdiff -f -z 2- short1 short2</samp>’ displays |
| 4319 |
</p><div class="example"> |
| 4320 |
<pre class="example"> > ****************** |
| 4321 |
0.001 -3 0.0010000 -3 |
| 4322 |
0.01 -2 .0100 -2 |
| 4323 |
0.1 -1 0000.10 -1 |
| 4324 |
1 0 1. 0 |
| 4325 |
1000 3 1,000.000 3 |
| 4326 |
1000000 6 1,000,000. 6 |
| 4327 |
1000000000 9 1,000,000,000 9 |
| 4328 |
|
| 4329 |
|
| 4330 |
+++ File "short1" differs from file "short2" |
| 4331 |
</pre></div> |
| 4332 |
|
| 4333 |
<p>showing that the filter has matched |
| 4334 |
the lines in the right way. |
| 4335 |
</p> |
| 4336 |
<p>The filter can even handle the case |
| 4337 |
when the same numerical value is written in |
| 4338 |
decimal notation in one file and in scientific |
| 4339 |
notation in the other one. |
| 4340 |
If the files <samp>decimal</samp> and <samp>scientific</samp> contain |
| 4341 |
</p><pre class="verbatim">.001 -3 |
| 4342 |
.01 -2 |
| 4343 |
.1 -1 |
| 4344 |
* * * * * * * * * |
| 4345 |
1 0 |
| 4346 |
1000 3 |
| 4347 |
1000000 6 |
| 4348 |
1000000000 9 |
| 4349 |
</pre> |
| 4350 |
<p>and |
| 4351 |
</p><pre class="verbatim">***************** |
| 4352 |
1.0e-3 -3 |
| 4353 |
1.0e-2 -2 |
| 4354 |
1.0e-1 -1 |
| 4355 |
1.0e0 0 |
| 4356 |
1.0e3 3 |
| 4357 |
1.0e6 6 |
| 4358 |
1.0e9 9 |
| 4359 |
***************** |
| 4360 |
</pre> |
| 4361 |
<p>respectively, then ‘<samp>numdiff -f -z 2- decimal scientific</samp>’ prints |
| 4362 |
</p><div class="example"> |
| 4363 |
<pre class="example"> > ***************** |
| 4364 |
.001 -3 1.0e-3 -3 |
| 4365 |
.01 -2 1.0e-2 -2 |
| 4366 |
.1 -1 1.0e-1 -1 |
| 4367 |
* * * * * * * * * < |
| 4368 |
1 0 1.0e0 0 |
| 4369 |
1000 3 1.0e3 3 |
| 4370 |
1000000 6 1.0e6 6 |
| 4371 |
1000000000 9 1.0e9 9 |
| 4372 |
> ***************** |
| 4373 |
|
| 4374 |
|
| 4375 |
+++ File "decimal" differs from file "scientific" |
| 4376 |
</pre></div> |
| 4377 |
|
| 4378 |
<p>proving that the filter does not get confused. |
| 4379 |
</p> |
| 4380 |
<p>No problems arise also in the case when for the same field |
| 4381 |
the scientific notation is used in both files. |
| 4382 |
If the files <samp>sc1</samp> and <samp>sc2</samp> contain |
| 4383 |
</p><pre class="verbatim"> 1.E-3 -3 |
| 4384 |
1.00E-2 -2 |
| 4385 |
1.0E-1 -1 |
| 4386 |
1.0000E0 0 |
| 4387 |
001.0E3 3 |
| 4388 |
+01.000E6 6 |
| 4389 |
1.0E+09 9 |
| 4390 |
1.0E+10 10 |
| 4391 |
* * * * * * * * * * |
| 4392 |
</pre> |
| 4393 |
<p>and |
| 4394 |
</p><pre class="verbatim">***************** |
| 4395 |
1.0e-003 -3 |
| 4396 |
1.0e-2 -2 |
| 4397 |
1.0e-1 -1 |
| 4398 |
1.0e0 0 |
| 4399 |
+1.0e3 3 |
| 4400 |
1.0e+6 6 |
| 4401 |
1.0e9 9 |
| 4402 |
</pre> |
| 4403 |
<p>respectively, then ‘<samp>numdiff -f -z 2- sc1 sc2</samp>’ |
| 4404 |
correctly displays |
| 4405 |
</p><div class="example"> |
| 4406 |
<pre class="example"> > ***************** |
| 4407 |
1.E-3 -3 1.0e-003 -3 |
| 4408 |
1.00E-2 -2 1.0e-2 -2 |
| 4409 |
1.0E-1 -1 1.0e-1 -1 |
| 4410 |
1.0000E0 0 1.0e0 0 |
| 4411 |
001.0E3 3 +1.0e3 3 |
| 4412 |
+01.000E6 6 1.0e+6 6 |
| 4413 |
1.0E+09 9 1.0e9 9 |
| 4414 |
1.0E+10 10 < |
| 4415 |
* * * * * * * * * * < |
| 4416 |
|
| 4417 |
|
| 4418 |
+++ File "sc1" differs from file "sc2" |
| 4419 |
</pre></div> |
| 4420 |
|
| 4421 |
|
| 4422 |
<p>The filter can even handle an improper use |
| 4423 |
of the scientific notation, meaning for example that |
| 4424 |
it can recognize ‘<samp>123.456E+2</samp>’ |
| 4425 |
and ‘<samp>1.23456E+4</samp>’ as equal. |
| 4426 |
</p> |
| 4427 |
<p>We can see this in the case of the files <samp>Scnot1</samp>: |
| 4428 |
</p><pre class="verbatim">------------------------- |
| 4429 |
1.2E0 * 1 |
| 4430 |
2.45E-1 * 2 |
| 4431 |
-3.678E-2 * 3 |
| 4432 |
</pre> |
| 4433 |
<p>and <samp>Scnot2</samp>: |
| 4434 |
</p><pre class="verbatim">12E-1 * 1 |
| 4435 |
245E-3 * 2 |
| 4436 |
-0.003678E+1 * 3 |
| 4437 |
</pre> |
| 4438 |
<p>‘<samp>numdiff -f -z 3- Scnot1 Scnot2</samp>’ |
| 4439 |
displays the report: |
| 4440 |
</p><div class="example"> |
| 4441 |
<pre class="example">------------------------- < |
| 4442 |
1.2E0 * 1 12E-1 * 1 |
| 4443 |
2.45E-1 * 2 245E-3 * 2 |
| 4444 |
-3.678E-2 * 3 -0.003678E+1 * 3 |
| 4445 |
|
| 4446 |
|
| 4447 |
+++ File "Scnot1" differs from file "Scnot2" |
| 4448 |
</pre></div> |
| 4449 |
|
| 4450 |
<p>which is exactly what you would expect in such a case. |
| 4451 |
Also pretty hard cases do not confuse the filter. |
| 4452 |
If <samp>Scnot1</samp> is given by |
| 4453 |
</p><pre class="verbatim"> 1.2000e0 * 1 |
| 4454 |
02.4500e-1 * 2 |
| 4455 |
-003.678E-2 * 3 |
| 4456 |
</pre> |
| 4457 |
<p>and <samp>Scnot2</samp> is the same file as before, the output of |
| 4458 |
the command ‘<samp>numdiff -f -z 3- Scnot1 Scnot2</samp>’ is still right: |
| 4459 |
</p><div class="example"> |
| 4460 |
<pre class="example"> 1.2000e0 * 1 12E-1 * 1 |
| 4461 |
02.4500e-1 * 2 245E-3 * 2 |
| 4462 |
-003.678E-2 * 3 -0.003678E+1 * 3 |
| 4463 |
|
| 4464 |
|
| 4465 |
+++ Files "Scnot1" and "Scnot2" have the same structure |
| 4466 |
</pre></div> |
| 4467 |
|
| 4468 |
<p>In all examples above the option <samp>-f</samp> is used with no argument. |
| 4469 |
<a name="Use-of-the-option-_002df"></a></p> |
| 4470 |
<p>However, <samp>-f</samp> accepts an optional argument, which can be used to control |
| 4471 |
how <samp>-f</samp> displays its output. |
| 4472 |
If you provide an argument, care not to leave any space |
| 4473 |
between the option and the argument: |
| 4474 |
‘<samp>-f60</samp>’ is correct while ‘<samp>-f 60</samp>’ |
| 4475 |
makes Numdiff terminate after printing an error message. |
| 4476 |
</p> |
| 4477 |
<p>If the argument is a positive number <var>NUM</var>, then |
| 4478 |
the side-by-side output produced by <samp>-f</samp> |
| 4479 |
will be <var>NUM</var> columns wide. The default value |
| 4480 |
for the width of the output is 130, which can fit onto a |
| 4481 |
traditional printer line, and is the one used |
| 4482 |
when <samp>-f</samp> has no argument, or the supplied argument is zero. |
| 4483 |
In other words, ‘<samp>-f</samp>’ and ‘<samp>-f0</samp>’ are just easier to remind |
| 4484 |
versions of ‘<samp>-f130</samp>’. |
| 4485 |
</p> |
| 4486 |
<p>A negative argument has the same effect as the positive argument |
| 4487 |
with the same absolute value, but it causes in addition the removal of |
| 4488 |
common lines from the output. |
| 4489 |
For example, the command ‘<samp>numdiff -z 1:2 -Z 2:2 -f-130 Table1 Table2</samp>’ |
| 4490 |
displays the following text |
| 4491 |
</p><div class="example"> |
| 4492 |
<pre class="example">-5 2.236068 < |
| 4493 |
-3 1.732051 < |
| 4494 |
-1 1.000000 < |
| 4495 |
- - - - - - - - - < |
| 4496 |
1 1.000000 < |
| 4497 |
3 1.732051 < |
| 4498 |
- - - - - - - - - < |
| 4499 |
5 2.236068 < |
| 4500 |
7 2.645751 < |
| 4501 |
- - - - - - - - - < |
| 4502 |
9 3.000000 < |
| 4503 |
11 3.316625 < |
| 4504 |
- - - - - - - - - < |
| 4505 |
- - - - - - - - - < |
| 4506 |
13 3.605551 < |
| 4507 |
> ********************END |
| 4508 |
|
| 4509 |
|
| 4510 |
+++ File "Table1" differs from file "Table2" |
| 4511 |
</pre></div> |
| 4512 |
|
| 4513 |
<p>In conjunction with the option <samp>-f</samp> or <samp>-O</samp> you can use |
| 4514 |
<samp>-T</samp> to expand tabs to spaces in the produced output. |
| 4515 |
This is useful to preserve the alignment of tabs in the input files, |
| 4516 |
if it is thrown off by the presence of the gutter. |
| 4517 |
</p> |
| 4518 |
<p>The options <samp>-H</samp> and <samp>-m</samp> affect the |
| 4519 |
performance of the filter of Numdiff. |
| 4520 |
But performance has more than one dimension and |
| 4521 |
these options improve one aspect of performance at |
| 4522 |
the cost of another, or they improve performance in some cases while |
| 4523 |
hurting it in others. |
| 4524 |
</p> |
| 4525 |
<p>The re-synchronization of the two compared files made by the filter always |
| 4526 |
comes up with a near-minimal set of deletions/insertions of lines, that |
| 4527 |
usually is good enough for practical purposes. |
| 4528 |
If the filter displays a large set of line deletions/insertions, you |
| 4529 |
might want it to use a modified algorithm that sometimes produces a |
| 4530 |
smaller set of differences. The <samp>-m</samp> option does this; |
| 4531 |
however, it can also cause the filter to run more slowly than usual, |
| 4532 |
so it is not the default behavior. |
| 4533 |
</p> |
| 4534 |
<p>If the files you are comparing are large and have small groups of |
| 4535 |
changes scattered throughout them, you can use the |
| 4536 |
<samp>-H</samp> option to make a different modification to the |
| 4537 |
algorithm employed by the filter. If the input files have a constant small |
| 4538 |
density of changes, where change means here deletion/insertion of lines, |
| 4539 |
this option speeds up the comparison without |
| 4540 |
changing the output or in the worst case introducing minor modifications. |
| 4541 |
</p> |
| 4542 |
<hr> |
| 4543 |
<a name="Warnings"></a> |
| 4544 |
<div class="header"> |
| 4545 |
<p> |
| 4546 |
Next: <a href="#Index" accesskey="n" rel="next">Index</a>, Previous: <a href="#Filtering" accesskey="p" rel="prev">Filtering</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 4547 |
</div> |
| 4548 |
<a name="Warnings-1"></a> |
| 4549 |
<h2 class="chapter">9 Warnings</h2> |
| 4550 |
|
| 4551 |
<a name="index-Warnings"></a> |
| 4552 |
<a name="index-Notes"></a> |
| 4553 |
<a name="index-Caveats"></a> |
| 4554 |
|
| 4555 |
<ul> |
| 4556 |
<li> Bug reports have to be sent to the address |
| 4557 |
<a href="mailto:ivprimi(at)libero(dot)it">ivprimi(at)libero(dot)it</a> . Please, put Numdiff |
| 4558 |
in the subject and indicate the version of the operating system you |
| 4559 |
are running (in particular, do not forget to specify if |
| 4560 |
it is a 32- or a 64-bit system), and, if you know it, |
| 4561 |
the version of the compiler used to build Numdiff. |
| 4562 |
Please write also whether your version |
| 4563 |
of Numdiff uses the GNU MP library or not. |
| 4564 |
Before writing an email be sure to run the latest |
| 4565 |
stable version of Numdiff, I do not provide |
| 4566 |
support for older versions. |
| 4567 |
|
| 4568 |
</li><li> Numdiff does not accept numbers in scientific notation |
| 4569 |
whose exponents lie outside the range -1073741824, …, +1073741824. |
| 4570 |
If such a number is found in any of the files to compare, |
| 4571 |
the execution of the program is stopped |
| 4572 |
after printing a suitable error message on stderr. |
| 4573 |
Under the assumption that the numeric format in use is the default one, |
| 4574 |
with "1.0001e-2147483640" the displayed error messages is |
| 4575 |
<div class="example"> |
| 4576 |
<pre class="example">numdiff: A number with a too small exponent has been found, |
| 4577 |
namely "1.0001e-2147483640". |
| 4578 |
Exponents smaller than -1073741824 are not accepted, |
| 4579 |
the execution of the program ends now |
| 4580 |
</pre></div> |
| 4581 |
|
| 4582 |
</li><li> <a name="with-GNU-MP-is-better"></a>If Numdiff has been built with its own internal support |
| 4583 |
for multiple precision arithmetic instead of being linked |
| 4584 |
against the GNU MP Library, |
| 4585 |
then performance degradation and memory exhaustion can already make |
| 4586 |
impossible to handle exponents of magnitude <em>10^6 = 1000000</em>. |
| 4587 |
This is what I obtained on my laptop, equipped with a dual core processor @1.50 GHz |
| 4588 |
and with 1GB of RAM, when I tried to compare |
| 4589 |
the numbers 1.101e1000000000 and 1.0e1000000000: |
| 4590 |
<div class="example"> |
| 4591 |
<pre class="example">numdiff: Insufficient memory for new allocation, |
| 4592 |
the execution of the program ends now |
| 4593 |
</pre></div> |
| 4594 |
<p>In addition, you can overload the processor with numbers |
| 4595 |
whose exponents lie outside the range -1000000, …, 1000000. |
| 4596 |
But at least on my machine, everything works fine and quick enough |
| 4597 |
as long as exponent and size of the mantissa of the numbers |
| 4598 |
are in the range -1000, …, 1000. |
| 4599 |
Be careful and remember that Numdiff is distributed |
| 4600 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
| 4601 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 4602 |
</p> |
| 4603 |
<p>Consider also that, if you have numeric data with exponents |
| 4604 |
outside the range -300, …, 300, probably there is something |
| 4605 |
wrong with your data: either you are using the wrong scale, |
| 4606 |
or you should replace very small numbers, like 1e-100, by zero, |
| 4607 |
or it is quite likely that the machine/program/algorithm which |
| 4608 |
produced these data is not working right. |
| 4609 |
</p> |
| 4610 |
</li><li> If Numdiff has been linked against the |
| 4611 |
GNU Multiple Precision Arithmetic Library (also called GNU MP), |
| 4612 |
then the precision it uses is typically higher |
| 4613 |
than the specified one. On my machine the actual value |
| 4614 |
of the precision is 20 if the user gives a value between 0 and 20, |
| 4615 |
30 if the user specifies a precision between 21 and 30, |
| 4616 |
40 for a user-specified value between 31 and 40, and so on. |
| 4617 |
Anyway, the actual precision is never less than |
| 4618 |
the one required by the user. |
| 4619 |
|
| 4620 |
</li><li> After reading a numeric field, Numdiff truncates its value |
| 4621 |
if this number has <i>too much</i> digits with respect |
| 4622 |
to the current precision. |
| 4623 |
To be precise, denoted by |
| 4624 |
<var>P</var> the current value of the precision, the following |
| 4625 |
rules apply. |
| 4626 |
|
| 4627 |
<p>If <code>numdiff</code> has been built with |
| 4628 |
its own internal support for multiple precision arithmetic, then |
| 4629 |
</p><ul> |
| 4630 |
<li> if the number is written in ordinary decimal notation, <code>numdiff</code> |
| 4631 |
will consider, in addition to all digits of the integer part, only |
| 4632 |
the first <var>P</var> digits of the fractional part; |
| 4633 |
</li><li> if the value is written in scientific notation, then <code>numdiff</code> |
| 4634 |
will only consider the first <var>P</var> digits of the fractional part |
| 4635 |
of the mantissa. |
| 4636 |
</li></ul> |
| 4637 |
|
| 4638 |
<p>If <code>numdiff</code> uses the GNU MP library |
| 4639 |
to perform its computations, the value of a numeric |
| 4640 |
field is first translated into scientific notation and then |
| 4641 |
only the first <var>P</var> digits of the fractional part |
| 4642 |
of the mantissa are considered. |
| 4643 |
</p> |
| 4644 |
<p>By current value of the precision I mean the integer value |
| 4645 |
specified by the option <samp>-#</samp>, or the default one (35) |
| 4646 |
when this option is not in use. |
| 4647 |
</p> |
| 4648 |
</li><li> You can find out whether your local version of <code>numdiff</code> |
| 4649 |
is relying on GNU MP or not by executing the command ‘<samp>numdiff -v</samp>’. |
| 4650 |
If <code>numdiff</code> uses GNU MP, then this command will display |
| 4651 |
the following message or similar (possibly translated |
| 4652 |
into your mother language) among other information: |
| 4653 |
<div class="example"> |
| 4654 |
<pre class="example">The software has been linked against |
| 4655 |
the GNU Multiple Precision Arithmetic Library, |
| 4656 |
version number 4.2.4. |
| 4657 |
</pre></div> |
| 4658 |
|
| 4659 |
<p>If <code>numdiff</code> does not rely on GNU MP, then |
| 4660 |
the displayed message will be (up to translation into |
| 4661 |
your mother language) |
| 4662 |
</p><div class="example"> |
| 4663 |
<pre class="example">The software has been built with |
| 4664 |
its own internal support for multiple precision arithmetic. |
| 4665 |
</pre></div> |
| 4666 |
|
| 4667 |
</li><li> Numdiff can only be used on text files: |
| 4668 |
the program terminates after printing a suitable error message |
| 4669 |
if one of the files to compare turns out to be a binary file. |
| 4670 |
To detect if a file is binary or not, <code>numdiff</code> checks |
| 4671 |
for the presence of null bytes (0x00) in the file. |
| 4672 |
|
| 4673 |
</li><li> If you are not including the so called white-space characters |
| 4674 |
(usually ‘<samp> </samp>’, ‘<samp>\t</samp>’, ‘<samp>\f</samp>’, ‘<samp>\v</samp>’ and ‘<samp>\r</samp>’) |
| 4675 |
in the set of field delimiters, then a real and an imaginary number |
| 4676 |
which are separated just by white-spaces can be coupled together |
| 4677 |
and considered as a whole complex number. |
| 4678 |
For example, if you are using only <strong>colon</strong> (‘<samp>:</samp>’) and |
| 4679 |
<strong>newline</strong> as field delimiters and Numdiff finds a line |
| 4680 |
like that |
| 4681 |
<pre class="verbatim">::::3.0-5.6e-356i::::-12.9 +4.34i::::-12.9 4.34i::::New York:::: |
| 4682 |
</pre> |
| 4683 |
<p>then it will consider this line as formed by four fields, the first two |
| 4684 |
are numeric and given by the complex numbers <i>3.0-5.6e-356i</i> and |
| 4685 |
<i>-12.9+4.34i</i>, the last two ones are the strings <tt>New York</tt> |
| 4686 |
and <tt>-12.9 4.34i</tt>. |
| 4687 |
I still do not know if I will modify this in the next version |
| 4688 |
of Numdiff, so that the program recognizes only <tt>3.0-5.6e-356i</tt> |
| 4689 |
as numeric field and treats <tt>-12.9 +4.34i</tt> as non-numeric |
| 4690 |
due to the presence of spaces in the middle. |
| 4691 |
<tt>-12.9 4.34i</tt> is already considered as non-numeric |
| 4692 |
due to the absence of a leading sign in the imaginary value. |
| 4693 |
</p> |
| 4694 |
</li><li> We have seen that one of the two files passed to <code>numdiff</code> |
| 4695 |
can be <tt>-</tt>, which refers to stdin (standard input). In this way one of |
| 4696 |
the two files to compare can be the output produced by another |
| 4697 |
command, like in ‘<samp>cat file2 | numdiff -a 1.0e-3 file1 -</samp>’. |
| 4698 |
However, if you activate the filter by means of the options <samp>-z</samp> or/and |
| 4699 |
<samp>-Z</samp>, Numdiff can not work with the standard input unless you |
| 4700 |
use also the option <samp>-f</samp>. Therefore, the command |
| 4701 |
‘<samp>cat file2 | numdiff -a 1.0e-3 -z @ file1 -</samp>’ |
| 4702 |
displays only the error message |
| 4703 |
<pre class="verbatim">numdiff: -: Illegal seek |
| 4704 |
</pre><p>(or maybe the translation of this message in the language |
| 4705 |
you are using on your computer) |
| 4706 |
but ‘<samp>cat file2 | numdiff -a 1.0e-3 -z @ -f file1 -</samp>’ |
| 4707 |
works as expected. |
| 4708 |
</p> |
| 4709 |
</li><li> This manual describes the version 5.9 of Numdiff. |
| 4710 |
Prior 5.x versions did not recognize all the options that are |
| 4711 |
currently accepted, versions 4.0.0 and 3.x used even a |
| 4712 |
different format for the output. |
| 4713 |
</li></ul> |
| 4714 |
|
| 4715 |
<hr> |
| 4716 |
<a name="GNU-Free-Documentation-License"></a> |
| 4717 |
<div class="header"> |
| 4718 |
<p> |
| 4719 |
Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 4720 |
</div> |
| 4721 |
<a name="GNU-Free-Documentation-License-1"></a> |
| 4722 |
<h2 class="appendix">Appendix A GNU Free Documentation License</h2> |
| 4723 |
|
| 4724 |
<a name="index-GNU-Free-Documentation-License"></a> |
| 4725 |
<a name="index-GNU-FDL"></a> |
| 4726 |
<a name="index-FDL"></a> |
| 4727 |
|
| 4728 |
<div align="center">Version 1.3, 3 November 2008 |
| 4729 |
</div> |
| 4730 |
|
| 4731 |
<div class="display"> |
| 4732 |
<pre class="display">Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. |
| 4733 |
<a href="http://fsf.org/">http://fsf.org/</a> |
| 4734 |
|
| 4735 |
Everyone is permitted to copy and distribute verbatim copies |
| 4736 |
of this license document, but changing it is not allowed. |
| 4737 |
</pre></div> |
| 4738 |
|
| 4739 |
<ol> |
| 4740 |
<li> PREAMBLE |
| 4741 |
|
| 4742 |
<p>The purpose of this License is to make a manual, textbook, or other |
| 4743 |
functional and useful document <em>free</em> in the sense of freedom: to |
| 4744 |
assure everyone the effective freedom to copy and redistribute it, |
| 4745 |
with or without modifying it, either commercially or noncommercially. |
| 4746 |
Secondarily, this License preserves for the author and publisher a way |
| 4747 |
to get credit for their work, while not being considered responsible |
| 4748 |
for modifications made by others. |
| 4749 |
</p> |
| 4750 |
<p>This License is a kind of “copyleft”, which means that derivative |
| 4751 |
works of the document must themselves be free in the same sense. It |
| 4752 |
complements the GNU General Public License, which is a copyleft |
| 4753 |
license designed for free software. |
| 4754 |
</p> |
| 4755 |
<p>We have designed this License in order to use it for manuals for free |
| 4756 |
software, because free software needs free documentation: a free |
| 4757 |
program should come with manuals providing the same freedoms that the |
| 4758 |
software does. But this License is not limited to software manuals; |
| 4759 |
it can be used for any textual work, regardless of subject matter or |
| 4760 |
whether it is published as a printed book. We recommend this License |
| 4761 |
principally for works whose purpose is instruction or reference. |
| 4762 |
</p> |
| 4763 |
</li><li> APPLICABILITY AND DEFINITIONS |
| 4764 |
|
| 4765 |
<p>This License applies to any manual or other work, in any medium, that |
| 4766 |
contains a notice placed by the copyright holder saying it can be |
| 4767 |
distributed under the terms of this License. Such a notice grants a |
| 4768 |
world-wide, royalty-free license, unlimited in duration, to use that |
| 4769 |
work under the conditions stated herein. The “Document”, below, |
| 4770 |
refers to any such manual or work. Any member of the public is a |
| 4771 |
licensee, and is addressed as “you”. You accept the license if you |
| 4772 |
copy, modify or distribute the work in a way requiring permission |
| 4773 |
under copyright law. |
| 4774 |
</p> |
| 4775 |
<p>A “Modified Version” of the Document means any work containing the |
| 4776 |
Document or a portion of it, either copied verbatim, or with |
| 4777 |
modifications and/or translated into another language. |
| 4778 |
</p> |
| 4779 |
<p>A “Secondary Section” is a named appendix or a front-matter section |
| 4780 |
of the Document that deals exclusively with the relationship of the |
| 4781 |
publishers or authors of the Document to the Document’s overall |
| 4782 |
subject (or to related matters) and contains nothing that could fall |
| 4783 |
directly within that overall subject. (Thus, if the Document is in |
| 4784 |
part a textbook of mathematics, a Secondary Section may not explain |
| 4785 |
any mathematics.) The relationship could be a matter of historical |
| 4786 |
connection with the subject or with related matters, or of legal, |
| 4787 |
commercial, philosophical, ethical or political position regarding |
| 4788 |
them. |
| 4789 |
</p> |
| 4790 |
<p>The “Invariant Sections” are certain Secondary Sections whose titles |
| 4791 |
are designated, as being those of Invariant Sections, in the notice |
| 4792 |
that says that the Document is released under this License. If a |
| 4793 |
section does not fit the above definition of Secondary then it is not |
| 4794 |
allowed to be designated as Invariant. The Document may contain zero |
| 4795 |
Invariant Sections. If the Document does not identify any Invariant |
| 4796 |
Sections then there are none. |
| 4797 |
</p> |
| 4798 |
<p>The “Cover Texts” are certain short passages of text that are listed, |
| 4799 |
as Front-Cover Texts or Back-Cover Texts, in the notice that says that |
| 4800 |
the Document is released under this License. A Front-Cover Text may |
| 4801 |
be at most 5 words, and a Back-Cover Text may be at most 25 words. |
| 4802 |
</p> |
| 4803 |
<p>A “Transparent” copy of the Document means a machine-readable copy, |
| 4804 |
represented in a format whose specification is available to the |
| 4805 |
general public, that is suitable for revising the document |
| 4806 |
straightforwardly with generic text editors or (for images composed of |
| 4807 |
pixels) generic paint programs or (for drawings) some widely available |
| 4808 |
drawing editor, and that is suitable for input to text formatters or |
| 4809 |
for automatic translation to a variety of formats suitable for input |
| 4810 |
to text formatters. A copy made in an otherwise Transparent file |
| 4811 |
format whose markup, or absence of markup, has been arranged to thwart |
| 4812 |
or discourage subsequent modification by readers is not Transparent. |
| 4813 |
An image format is not Transparent if used for any substantial amount |
| 4814 |
of text. A copy that is not “Transparent” is called “Opaque”. |
| 4815 |
</p> |
| 4816 |
<p>Examples of suitable formats for Transparent copies include plain |
| 4817 |
<small>ASCII</small> without markup, Texinfo input format, LaTeX input |
| 4818 |
format, <acronym>SGML</acronym> or <acronym>XML</acronym> using a publicly available |
| 4819 |
<acronym>DTD</acronym>, and standard-conforming simple <acronym>HTML</acronym>, |
| 4820 |
PostScript or <acronym>PDF</acronym> designed for human modification. Examples |
| 4821 |
of transparent image formats include <acronym>PNG</acronym>, <acronym>XCF</acronym> and |
| 4822 |
<acronym>JPG</acronym>. Opaque formats include proprietary formats that can be |
| 4823 |
read and edited only by proprietary word processors, <acronym>SGML</acronym> or |
| 4824 |
<acronym>XML</acronym> for which the <acronym>DTD</acronym> and/or processing tools are |
| 4825 |
not generally available, and the machine-generated <acronym>HTML</acronym>, |
| 4826 |
PostScript or <acronym>PDF</acronym> produced by some word processors for |
| 4827 |
output purposes only. |
| 4828 |
</p> |
| 4829 |
<p>The “Title Page” means, for a printed book, the title page itself, |
| 4830 |
plus such following pages as are needed to hold, legibly, the material |
| 4831 |
this License requires to appear in the title page. For works in |
| 4832 |
formats which do not have any title page as such, “Title Page” means |
| 4833 |
the text near the most prominent appearance of the work’s title, |
| 4834 |
preceding the beginning of the body of the text. |
| 4835 |
</p> |
| 4836 |
<p>The “publisher” means any person or entity that distributes copies |
| 4837 |
of the Document to the public. |
| 4838 |
</p> |
| 4839 |
<p>A section “Entitled XYZ” means a named subunit of the Document whose |
| 4840 |
title either is precisely XYZ or contains XYZ in parentheses following |
| 4841 |
text that translates XYZ in another language. (Here XYZ stands for a |
| 4842 |
specific section name mentioned below, such as “Acknowledgements”, |
| 4843 |
“Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” |
| 4844 |
of such a section when you modify the Document means that it remains a |
| 4845 |
section “Entitled XYZ” according to this definition. |
| 4846 |
</p> |
| 4847 |
<p>The Document may include Warranty Disclaimers next to the notice which |
| 4848 |
states that this License applies to the Document. These Warranty |
| 4849 |
Disclaimers are considered to be included by reference in this |
| 4850 |
License, but only as regards disclaiming warranties: any other |
| 4851 |
implication that these Warranty Disclaimers may have is void and has |
| 4852 |
no effect on the meaning of this License. |
| 4853 |
</p> |
| 4854 |
</li><li> VERBATIM COPYING |
| 4855 |
|
| 4856 |
<p>You may copy and distribute the Document in any medium, either |
| 4857 |
commercially or noncommercially, provided that this License, the |
| 4858 |
copyright notices, and the license notice saying this License applies |
| 4859 |
to the Document are reproduced in all copies, and that you add no other |
| 4860 |
conditions whatsoever to those of this License. You may not use |
| 4861 |
technical measures to obstruct or control the reading or further |
| 4862 |
copying of the copies you make or distribute. However, you may accept |
| 4863 |
compensation in exchange for copies. If you distribute a large enough |
| 4864 |
number of copies you must also follow the conditions in section 3. |
| 4865 |
</p> |
| 4866 |
<p>You may also lend copies, under the same conditions stated above, and |
| 4867 |
you may publicly display copies. |
| 4868 |
</p> |
| 4869 |
</li><li> COPYING IN QUANTITY |
| 4870 |
|
| 4871 |
<p>If you publish printed copies (or copies in media that commonly have |
| 4872 |
printed covers) of the Document, numbering more than 100, and the |
| 4873 |
Document’s license notice requires Cover Texts, you must enclose the |
| 4874 |
copies in covers that carry, clearly and legibly, all these Cover |
| 4875 |
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on |
| 4876 |
the back cover. Both covers must also clearly and legibly identify |
| 4877 |
you as the publisher of these copies. The front cover must present |
| 4878 |
the full title with all words of the title equally prominent and |
| 4879 |
visible. You may add other material on the covers in addition. |
| 4880 |
Copying with changes limited to the covers, as long as they preserve |
| 4881 |
the title of the Document and satisfy these conditions, can be treated |
| 4882 |
as verbatim copying in other respects. |
| 4883 |
</p> |
| 4884 |
<p>If the required texts for either cover are too voluminous to fit |
| 4885 |
legibly, you should put the first ones listed (as many as fit |
| 4886 |
reasonably) on the actual cover, and continue the rest onto adjacent |
| 4887 |
pages. |
| 4888 |
</p> |
| 4889 |
<p>If you publish or distribute Opaque copies of the Document numbering |
| 4890 |
more than 100, you must either include a machine-readable Transparent |
| 4891 |
copy along with each Opaque copy, or state in or with each Opaque copy |
| 4892 |
a computer-network location from which the general network-using |
| 4893 |
public has access to download using public-standard network protocols |
| 4894 |
a complete Transparent copy of the Document, free of added material. |
| 4895 |
If you use the latter option, you must take reasonably prudent steps, |
| 4896 |
when you begin distribution of Opaque copies in quantity, to ensure |
| 4897 |
that this Transparent copy will remain thus accessible at the stated |
| 4898 |
location until at least one year after the last time you distribute an |
| 4899 |
Opaque copy (directly or through your agents or retailers) of that |
| 4900 |
edition to the public. |
| 4901 |
</p> |
| 4902 |
<p>It is requested, but not required, that you contact the authors of the |
| 4903 |
Document well before redistributing any large number of copies, to give |
| 4904 |
them a chance to provide you with an updated version of the Document. |
| 4905 |
</p> |
| 4906 |
</li><li> MODIFICATIONS |
| 4907 |
|
| 4908 |
<p>You may copy and distribute a Modified Version of the Document under |
| 4909 |
the conditions of sections 2 and 3 above, provided that you release |
| 4910 |
the Modified Version under precisely this License, with the Modified |
| 4911 |
Version filling the role of the Document, thus licensing distribution |
| 4912 |
and modification of the Modified Version to whoever possesses a copy |
| 4913 |
of it. In addition, you must do these things in the Modified Version: |
| 4914 |
</p> |
| 4915 |
<ol> |
| 4916 |
<li> Use in the Title Page (and on the covers, if any) a title distinct |
| 4917 |
from that of the Document, and from those of previous versions |
| 4918 |
(which should, if there were any, be listed in the History section |
| 4919 |
of the Document). You may use the same title as a previous version |
| 4920 |
if the original publisher of that version gives permission. |
| 4921 |
|
| 4922 |
</li><li> List on the Title Page, as authors, one or more persons or entities |
| 4923 |
responsible for authorship of the modifications in the Modified |
| 4924 |
Version, together with at least five of the principal authors of the |
| 4925 |
Document (all of its principal authors, if it has fewer than five), |
| 4926 |
unless they release you from this requirement. |
| 4927 |
|
| 4928 |
</li><li> State on the Title page the name of the publisher of the |
| 4929 |
Modified Version, as the publisher. |
| 4930 |
|
| 4931 |
</li><li> Preserve all the copyright notices of the Document. |
| 4932 |
|
| 4933 |
</li><li> Add an appropriate copyright notice for your modifications |
| 4934 |
adjacent to the other copyright notices. |
| 4935 |
|
| 4936 |
</li><li> Include, immediately after the copyright notices, a license notice |
| 4937 |
giving the public permission to use the Modified Version under the |
| 4938 |
terms of this License, in the form shown in the Addendum below. |
| 4939 |
|
| 4940 |
</li><li> Preserve in that license notice the full lists of Invariant Sections |
| 4941 |
and required Cover Texts given in the Document’s license notice. |
| 4942 |
|
| 4943 |
</li><li> Include an unaltered copy of this License. |
| 4944 |
|
| 4945 |
</li><li> Preserve the section Entitled “History”, Preserve its Title, and add |
| 4946 |
to it an item stating at least the title, year, new authors, and |
| 4947 |
publisher of the Modified Version as given on the Title Page. If |
| 4948 |
there is no section Entitled “History” in the Document, create one |
| 4949 |
stating the title, year, authors, and publisher of the Document as |
| 4950 |
given on its Title Page, then add an item describing the Modified |
| 4951 |
Version as stated in the previous sentence. |
| 4952 |
|
| 4953 |
</li><li> Preserve the network location, if any, given in the Document for |
| 4954 |
public access to a Transparent copy of the Document, and likewise |
| 4955 |
the network locations given in the Document for previous versions |
| 4956 |
it was based on. These may be placed in the “History” section. |
| 4957 |
You may omit a network location for a work that was published at |
| 4958 |
least four years before the Document itself, or if the original |
| 4959 |
publisher of the version it refers to gives permission. |
| 4960 |
|
| 4961 |
</li><li> For any section Entitled “Acknowledgements” or “Dedications”, Preserve |
| 4962 |
the Title of the section, and preserve in the section all the |
| 4963 |
substance and tone of each of the contributor acknowledgements and/or |
| 4964 |
dedications given therein. |
| 4965 |
|
| 4966 |
</li><li> Preserve all the Invariant Sections of the Document, |
| 4967 |
unaltered in their text and in their titles. Section numbers |
| 4968 |
or the equivalent are not considered part of the section titles. |
| 4969 |
|
| 4970 |
</li><li> Delete any section Entitled “Endorsements”. Such a section |
| 4971 |
may not be included in the Modified Version. |
| 4972 |
|
| 4973 |
</li><li> Do not retitle any existing section to be Entitled “Endorsements” or |
| 4974 |
to conflict in title with any Invariant Section. |
| 4975 |
|
| 4976 |
</li><li> Preserve any Warranty Disclaimers. |
| 4977 |
</li></ol> |
| 4978 |
|
| 4979 |
<p>If the Modified Version includes new front-matter sections or |
| 4980 |
appendices that qualify as Secondary Sections and contain no material |
| 4981 |
copied from the Document, you may at your option designate some or all |
| 4982 |
of these sections as invariant. To do this, add their titles to the |
| 4983 |
list of Invariant Sections in the Modified Version’s license notice. |
| 4984 |
These titles must be distinct from any other section titles. |
| 4985 |
</p> |
| 4986 |
<p>You may add a section Entitled “Endorsements”, provided it contains |
| 4987 |
nothing but endorsements of your Modified Version by various |
| 4988 |
parties—for example, statements of peer review or that the text has |
| 4989 |
been approved by an organization as the authoritative definition of a |
| 4990 |
standard. |
| 4991 |
</p> |
| 4992 |
<p>You may add a passage of up to five words as a Front-Cover Text, and a |
| 4993 |
passage of up to 25 words as a Back-Cover Text, to the end of the list |
| 4994 |
of Cover Texts in the Modified Version. Only one passage of |
| 4995 |
Front-Cover Text and one of Back-Cover Text may be added by (or |
| 4996 |
through arrangements made by) any one entity. If the Document already |
| 4997 |
includes a cover text for the same cover, previously added by you or |
| 4998 |
by arrangement made by the same entity you are acting on behalf of, |
| 4999 |
you may not add another; but you may replace the old one, on explicit |
| 5000 |
permission from the previous publisher that added the old one. |
| 5001 |
</p> |
| 5002 |
<p>The author(s) and publisher(s) of the Document do not by this License |
| 5003 |
give permission to use their names for publicity for or to assert or |
| 5004 |
imply endorsement of any Modified Version. |
| 5005 |
</p> |
| 5006 |
</li><li> COMBINING DOCUMENTS |
| 5007 |
|
| 5008 |
<p>You may combine the Document with other documents released under this |
| 5009 |
License, under the terms defined in section 4 above for modified |
| 5010 |
versions, provided that you include in the combination all of the |
| 5011 |
Invariant Sections of all of the original documents, unmodified, and |
| 5012 |
list them all as Invariant Sections of your combined work in its |
| 5013 |
license notice, and that you preserve all their Warranty Disclaimers. |
| 5014 |
</p> |
| 5015 |
<p>The combined work need only contain one copy of this License, and |
| 5016 |
multiple identical Invariant Sections may be replaced with a single |
| 5017 |
copy. If there are multiple Invariant Sections with the same name but |
| 5018 |
different contents, make the title of each such section unique by |
| 5019 |
adding at the end of it, in parentheses, the name of the original |
| 5020 |
author or publisher of that section if known, or else a unique number. |
| 5021 |
Make the same adjustment to the section titles in the list of |
| 5022 |
Invariant Sections in the license notice of the combined work. |
| 5023 |
</p> |
| 5024 |
<p>In the combination, you must combine any sections Entitled “History” |
| 5025 |
in the various original documents, forming one section Entitled |
| 5026 |
“History”; likewise combine any sections Entitled “Acknowledgements”, |
| 5027 |
and any sections Entitled “Dedications”. You must delete all |
| 5028 |
sections Entitled “Endorsements.” |
| 5029 |
</p> |
| 5030 |
</li><li> COLLECTIONS OF DOCUMENTS |
| 5031 |
|
| 5032 |
<p>You may make a collection consisting of the Document and other documents |
| 5033 |
released under this License, and replace the individual copies of this |
| 5034 |
License in the various documents with a single copy that is included in |
| 5035 |
the collection, provided that you follow the rules of this License for |
| 5036 |
verbatim copying of each of the documents in all other respects. |
| 5037 |
</p> |
| 5038 |
<p>You may extract a single document from such a collection, and distribute |
| 5039 |
it individually under this License, provided you insert a copy of this |
| 5040 |
License into the extracted document, and follow this License in all |
| 5041 |
other respects regarding verbatim copying of that document. |
| 5042 |
</p> |
| 5043 |
</li><li> AGGREGATION WITH INDEPENDENT WORKS |
| 5044 |
|
| 5045 |
<p>A compilation of the Document or its derivatives with other separate |
| 5046 |
and independent documents or works, in or on a volume of a storage or |
| 5047 |
distribution medium, is called an “aggregate” if the copyright |
| 5048 |
resulting from the compilation is not used to limit the legal rights |
| 5049 |
of the compilation’s users beyond what the individual works permit. |
| 5050 |
When the Document is included in an aggregate, this License does not |
| 5051 |
apply to the other works in the aggregate which are not themselves |
| 5052 |
derivative works of the Document. |
| 5053 |
</p> |
| 5054 |
<p>If the Cover Text requirement of section 3 is applicable to these |
| 5055 |
copies of the Document, then if the Document is less than one half of |
| 5056 |
the entire aggregate, the Document’s Cover Texts may be placed on |
| 5057 |
covers that bracket the Document within the aggregate, or the |
| 5058 |
electronic equivalent of covers if the Document is in electronic form. |
| 5059 |
Otherwise they must appear on printed covers that bracket the whole |
| 5060 |
aggregate. |
| 5061 |
</p> |
| 5062 |
</li><li> TRANSLATION |
| 5063 |
|
| 5064 |
<p>Translation is considered a kind of modification, so you may |
| 5065 |
distribute translations of the Document under the terms of section 4. |
| 5066 |
Replacing Invariant Sections with translations requires special |
| 5067 |
permission from their copyright holders, but you may include |
| 5068 |
translations of some or all Invariant Sections in addition to the |
| 5069 |
original versions of these Invariant Sections. You may include a |
| 5070 |
translation of this License, and all the license notices in the |
| 5071 |
Document, and any Warranty Disclaimers, provided that you also include |
| 5072 |
the original English version of this License and the original versions |
| 5073 |
of those notices and disclaimers. In case of a disagreement between |
| 5074 |
the translation and the original version of this License or a notice |
| 5075 |
or disclaimer, the original version will prevail. |
| 5076 |
</p> |
| 5077 |
<p>If a section in the Document is Entitled “Acknowledgements”, |
| 5078 |
“Dedications”, or “History”, the requirement (section 4) to Preserve |
| 5079 |
its Title (section 1) will typically require changing the actual |
| 5080 |
title. |
| 5081 |
</p> |
| 5082 |
</li><li> TERMINATION |
| 5083 |
|
| 5084 |
<p>You may not copy, modify, sublicense, or distribute the Document |
| 5085 |
except as expressly provided under this License. Any attempt |
| 5086 |
otherwise to copy, modify, sublicense, or distribute it is void, and |
| 5087 |
will automatically terminate your rights under this License. |
| 5088 |
</p> |
| 5089 |
<p>However, if you cease all violation of this License, then your license |
| 5090 |
from a particular copyright holder is reinstated (a) provisionally, |
| 5091 |
unless and until the copyright holder explicitly and finally |
| 5092 |
terminates your license, and (b) permanently, if the copyright holder |
| 5093 |
fails to notify you of the violation by some reasonable means prior to |
| 5094 |
60 days after the cessation. |
| 5095 |
</p> |
| 5096 |
<p>Moreover, your license from a particular copyright holder is |
| 5097 |
reinstated permanently if the copyright holder notifies you of the |
| 5098 |
violation by some reasonable means, this is the first time you have |
| 5099 |
received notice of violation of this License (for any work) from that |
| 5100 |
copyright holder, and you cure the violation prior to 30 days after |
| 5101 |
your receipt of the notice. |
| 5102 |
</p> |
| 5103 |
<p>Termination of your rights under this section does not terminate the |
| 5104 |
licenses of parties who have received copies or rights from you under |
| 5105 |
this License. If your rights have been terminated and not permanently |
| 5106 |
reinstated, receipt of a copy of some or all of the same material does |
| 5107 |
not give you any rights to use it. |
| 5108 |
</p> |
| 5109 |
</li><li> FUTURE REVISIONS OF THIS LICENSE |
| 5110 |
|
| 5111 |
<p>The Free Software Foundation may publish new, revised versions |
| 5112 |
of the GNU Free Documentation License from time to time. Such new |
| 5113 |
versions will be similar in spirit to the present version, but may |
| 5114 |
differ in detail to address new problems or concerns. See |
| 5115 |
<a href="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</a>. |
| 5116 |
</p> |
| 5117 |
<p>Each version of the License is given a distinguishing version number. |
| 5118 |
If the Document specifies that a particular numbered version of this |
| 5119 |
License “or any later version” applies to it, you have the option of |
| 5120 |
following the terms and conditions either of that specified version or |
| 5121 |
of any later version that has been published (not as a draft) by the |
| 5122 |
Free Software Foundation. If the Document does not specify a version |
| 5123 |
number of this License, you may choose any version ever published (not |
| 5124 |
as a draft) by the Free Software Foundation. If the Document |
| 5125 |
specifies that a proxy can decide which future versions of this |
| 5126 |
License can be used, that proxy’s public statement of acceptance of a |
| 5127 |
version permanently authorizes you to choose that version for the |
| 5128 |
Document. |
| 5129 |
</p> |
| 5130 |
</li><li> RELICENSING |
| 5131 |
|
| 5132 |
<p>“Massive Multiauthor Collaboration Site” (or “MMC Site”) means any |
| 5133 |
World Wide Web server that publishes copyrightable works and also |
| 5134 |
provides prominent facilities for anybody to edit those works. A |
| 5135 |
public wiki that anybody can edit is an example of such a server. A |
| 5136 |
“Massive Multiauthor Collaboration” (or “MMC”) contained in the |
| 5137 |
site means any set of copyrightable works thus published on the MMC |
| 5138 |
site. |
| 5139 |
</p> |
| 5140 |
<p>“CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 |
| 5141 |
license published by Creative Commons Corporation, a not-for-profit |
| 5142 |
corporation with a principal place of business in San Francisco, |
| 5143 |
California, as well as future copyleft versions of that license |
| 5144 |
published by that same organization. |
| 5145 |
</p> |
| 5146 |
<p>“Incorporate” means to publish or republish a Document, in whole or |
| 5147 |
in part, as part of another Document. |
| 5148 |
</p> |
| 5149 |
<p>An MMC is “eligible for relicensing” if it is licensed under this |
| 5150 |
License, and if all works that were first published under this License |
| 5151 |
somewhere other than this MMC, and subsequently incorporated in whole |
| 5152 |
or in part into the MMC, (1) had no cover texts or invariant sections, |
| 5153 |
and (2) were thus incorporated prior to November 1, 2008. |
| 5154 |
</p> |
| 5155 |
<p>The operator of an MMC Site may republish an MMC contained in the site |
| 5156 |
under CC-BY-SA on the same site at any time before August 1, 2009, |
| 5157 |
provided the MMC is eligible for relicensing. |
| 5158 |
</p> |
| 5159 |
</li></ol> |
| 5160 |
|
| 5161 |
<a name="ADDENDUM_003a-How-to-use-this-License-for-your-documents"></a> |
| 5162 |
<h3 class="heading">ADDENDUM: How to use this License for your documents</h3> |
| 5163 |
|
| 5164 |
<p>To use this License in a document you have written, include a copy of |
| 5165 |
the License in the document and put the following copyright and |
| 5166 |
license notices just after the title page: |
| 5167 |
</p> |
| 5168 |
<div class="smallexample"> |
| 5169 |
<pre class="smallexample"> Copyright (C) <var>year</var> <var>your name</var>. |
| 5170 |
Permission is granted to copy, distribute and/or modify this document |
| 5171 |
under the terms of the GNU Free Documentation License, Version 1.3 |
| 5172 |
or any later version published by the Free Software Foundation; |
| 5173 |
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover |
| 5174 |
Texts. A copy of the license is included in the section entitled ``GNU |
| 5175 |
Free Documentation License''. |
| 5176 |
</pre></div> |
| 5177 |
|
| 5178 |
<p>If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, |
| 5179 |
replace the “with…Texts.” line with this: |
| 5180 |
</p> |
| 5181 |
<div class="smallexample"> |
| 5182 |
<pre class="smallexample"> with the Invariant Sections being <var>list their titles</var>, with |
| 5183 |
the Front-Cover Texts being <var>list</var>, and with the Back-Cover Texts |
| 5184 |
being <var>list</var>. |
| 5185 |
</pre></div> |
| 5186 |
|
| 5187 |
<p>If you have Invariant Sections without Cover Texts, or some other |
| 5188 |
combination of the three, merge those two alternatives to suit the |
| 5189 |
situation. |
| 5190 |
</p> |
| 5191 |
<p>If your document contains nontrivial examples of program code, we |
| 5192 |
recommend releasing these examples in parallel under your choice of |
| 5193 |
free software license, such as the GNU General Public License, |
| 5194 |
to permit their use in free software. |
| 5195 |
</p> |
| 5196 |
|
| 5197 |
|
| 5198 |
<hr> |
| 5199 |
<a name="Index"></a> |
| 5200 |
<div class="header"> |
| 5201 |
<p> |
| 5202 |
Previous: <a href="#Warnings" accesskey="p" rel="prev">Warnings</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> |
| 5203 |
</div> |
| 5204 |
<a name="Index-1"></a> |
| 5205 |
<h2 class="unnumbered">Index</h2> |
| 5206 |
|
| 5207 |
<table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#Index_cp_letter-A"><b>A</b></a> |
| 5208 |
|
| 5209 |
<a class="summary-letter" href="#Index_cp_letter-B"><b>B</b></a> |
| 5210 |
|
| 5211 |
<a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a> |
| 5212 |
|
| 5213 |
<a class="summary-letter" href="#Index_cp_letter-D"><b>D</b></a> |
| 5214 |
|
| 5215 |
<a class="summary-letter" href="#Index_cp_letter-F"><b>F</b></a> |
| 5216 |
|
| 5217 |
<a class="summary-letter" href="#Index_cp_letter-G"><b>G</b></a> |
| 5218 |
|
| 5219 |
<a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a> |
| 5220 |
|
| 5221 |
<a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a> |
| 5222 |
|
| 5223 |
<a class="summary-letter" href="#Index_cp_letter-L"><b>L</b></a> |
| 5224 |
|
| 5225 |
<a class="summary-letter" href="#Index_cp_letter-N"><b>N</b></a> |
| 5226 |
|
| 5227 |
<a class="summary-letter" href="#Index_cp_letter-O"><b>O</b></a> |
| 5228 |
|
| 5229 |
<a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a> |
| 5230 |
|
| 5231 |
<a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a> |
| 5232 |
|
| 5233 |
<a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a> |
| 5234 |
|
| 5235 |
<a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a> |
| 5236 |
|
| 5237 |
<a class="summary-letter" href="#Index_cp_letter-U"><b>U</b></a> |
| 5238 |
|
| 5239 |
<a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a> |
| 5240 |
|
| 5241 |
</td></tr></table> |
| 5242 |
<table class="index-cp" border="0"> |
| 5243 |
<tr><td></td><th align="left">Index Entry</th><td> </td><th align="left"> Section</th></tr> |
| 5244 |
<tr><td colspan="4"> <hr></td></tr> |
| 5245 |
<tr><th><a name="Index_cp_letter-A">A</a></th><td></td><td></td></tr> |
| 5246 |
<tr><td></td><td valign="top"><a href="#index-Acknowledgments">Acknowledgments</a>:</td><td> </td><td valign="top"><a href="#Acknowledgments">Acknowledgments</a></td></tr> |
| 5247 |
<tr><td colspan="4"> <hr></td></tr> |
| 5248 |
<tr><th><a name="Index_cp_letter-B">B</a></th><td></td><td></td></tr> |
| 5249 |
<tr><td></td><td valign="top"><a href="#index-Build">Build</a>:</td><td> </td><td valign="top"><a href="#Installing">Installing</a></td></tr> |
| 5250 |
<tr><td colspan="4"> <hr></td></tr> |
| 5251 |
<tr><th><a name="Index_cp_letter-C">C</a></th><td></td><td></td></tr> |
| 5252 |
<tr><td></td><td valign="top"><a href="#index-Caveats">Caveats</a>:</td><td> </td><td valign="top"><a href="#Warnings">Warnings</a></td></tr> |
| 5253 |
<tr><td></td><td valign="top"><a href="#index-Command-line-options-for-ndselect">Command line options for ndselect</a>:</td><td> </td><td valign="top"><a href="#Invoking-ndselect">Invoking ndselect</a></td></tr> |
| 5254 |
<tr><td></td><td valign="top"><a href="#index-Command-line-options-for-numdiff">Command line options for numdiff</a>:</td><td> </td><td valign="top"><a href="#Invoking-numdiff">Invoking numdiff</a></td></tr> |
| 5255 |
<tr><td></td><td valign="top"><a href="#index-Compile">Compile</a>:</td><td> </td><td valign="top"><a href="#Installing">Installing</a></td></tr> |
| 5256 |
<tr><td></td><td valign="top"><a href="#index-Copying-Conditions">Copying Conditions</a>:</td><td> </td><td valign="top"><a href="#Copying">Copying</a></td></tr> |
| 5257 |
<tr><td colspan="4"> <hr></td></tr> |
| 5258 |
<tr><th><a name="Index_cp_letter-D">D</a></th><td></td><td></td></tr> |
| 5259 |
<tr><td></td><td valign="top"><a href="#index-Diagnostics-_0028ndselect_0029">Diagnostics (ndselect)</a>:</td><td> </td><td valign="top"><a href="#Invoking-ndselect">Invoking ndselect</a></td></tr> |
| 5260 |
<tr><td></td><td valign="top"><a href="#index-Diagnostics-_0028numdiff_0029">Diagnostics (numdiff)</a>:</td><td> </td><td valign="top"><a href="#Invoking-numdiff">Invoking numdiff</a></td></tr> |
| 5261 |
<tr><td colspan="4"> <hr></td></tr> |
| 5262 |
<tr><th><a name="Index_cp_letter-F">F</a></th><td></td><td></td></tr> |
| 5263 |
<tr><td></td><td valign="top"><a href="#index-FDL">FDL</a>:</td><td> </td><td valign="top"><a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a></td></tr> |
| 5264 |
<tr><td></td><td valign="top"><a href="#index-Filter">Filter</a>:</td><td> </td><td valign="top"><a href="#Filtering">Filtering</a></td></tr> |
| 5265 |
<tr><td></td><td valign="top"><a href="#index-Filter-output-_0028numdiff_0029">Filter output (numdiff)</a>:</td><td> </td><td valign="top"><a href="#Filter-output">Filter output</a></td></tr> |
| 5266 |
<tr><td></td><td valign="top"><a href="#index-Format-of-the-reports">Format of the reports</a>:</td><td> </td><td valign="top"><a href="#Output-format">Output format</a></td></tr> |
| 5267 |
<tr><td colspan="4"> <hr></td></tr> |
| 5268 |
<tr><th><a name="Index_cp_letter-G">G</a></th><td></td><td></td></tr> |
| 5269 |
<tr><td></td><td valign="top"><a href="#index-GNU-FDL">GNU FDL</a>:</td><td> </td><td valign="top"><a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a></td></tr> |
| 5270 |
<tr><td></td><td valign="top"><a href="#index-GNU-Free-Documentation-License">GNU Free Documentation License</a>:</td><td> </td><td valign="top"><a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a></td></tr> |
| 5271 |
<tr><td></td><td valign="top"><a href="#index-GNU-General-Public-License">GNU General Public License</a>:</td><td> </td><td valign="top"><a href="#Copying">Copying</a></td></tr> |
| 5272 |
<tr><td></td><td valign="top"><a href="#index-GPL">GPL</a>:</td><td> </td><td valign="top"><a href="#Copying">Copying</a></td></tr> |
| 5273 |
<tr><td colspan="4"> <hr></td></tr> |
| 5274 |
<tr><th><a name="Index_cp_letter-H">H</a></th><td></td><td></td></tr> |
| 5275 |
<tr><td></td><td valign="top"><a href="#index-How-to-use-numdiff">How to use numdiff</a>:</td><td> </td><td valign="top"><a href="#Overview">Overview</a></td></tr> |
| 5276 |
<tr><td colspan="4"> <hr></td></tr> |
| 5277 |
<tr><th><a name="Index_cp_letter-I">I</a></th><td></td><td></td></tr> |
| 5278 |
<tr><td></td><td valign="top"><a href="#index-Install">Install</a>:</td><td> </td><td valign="top"><a href="#Installing">Installing</a></td></tr> |
| 5279 |
<tr><td></td><td valign="top"><a href="#index-Introduction">Introduction</a>:</td><td> </td><td valign="top"><a href="#Overview">Overview</a></td></tr> |
| 5280 |
<tr><td></td><td valign="top"><a href="#index-Invoking-ndselect">Invoking ndselect</a>:</td><td> </td><td valign="top"><a href="#Invoking-ndselect">Invoking ndselect</a></td></tr> |
| 5281 |
<tr><td></td><td valign="top"><a href="#index-Invoking-numdiff">Invoking numdiff</a>:</td><td> </td><td valign="top"><a href="#Invoking-numdiff">Invoking numdiff</a></td></tr> |
| 5282 |
<tr><td colspan="4"> <hr></td></tr> |
| 5283 |
<tr><th><a name="Index_cp_letter-L">L</a></th><td></td><td></td></tr> |
| 5284 |
<tr><td></td><td valign="top"><a href="#index-License">License</a>:</td><td> </td><td valign="top"><a href="#Copying">Copying</a></td></tr> |
| 5285 |
<tr><td colspan="4"> <hr></td></tr> |
| 5286 |
<tr><th><a name="Index_cp_letter-N">N</a></th><td></td><td></td></tr> |
| 5287 |
<tr><td></td><td valign="top"><a href="#index-ndselect-_0028introduction-to-its-use_0029">ndselect (introduction to its use)</a>:</td><td> </td><td valign="top"><a href="#ndselect">ndselect</a></td></tr> |
| 5288 |
<tr><td></td><td valign="top"><a href="#index-Notes">Notes</a>:</td><td> </td><td valign="top"><a href="#Warnings">Warnings</a></td></tr> |
| 5289 |
<tr><td colspan="4"> <hr></td></tr> |
| 5290 |
<tr><th><a name="Index_cp_letter-O">O</a></th><td></td><td></td></tr> |
| 5291 |
<tr><td></td><td valign="top"><a href="#index-Options_002c-command-line-_0028ndselect_0029">Options, command line (ndselect)</a>:</td><td> </td><td valign="top"><a href="#Invoking-ndselect">Invoking ndselect</a></td></tr> |
| 5292 |
<tr><td></td><td valign="top"><a href="#index-Options_002c-command-line-_0028numdiff_0029">Options, command line (numdiff)</a>:</td><td> </td><td valign="top"><a href="#Invoking-numdiff">Invoking numdiff</a></td></tr> |
| 5293 |
<tr><td></td><td valign="top"><a href="#index-Output-format-_0028numdiff_0029">Output format (numdiff)</a>:</td><td> </td><td valign="top"><a href="#Output-format">Output format</a></td></tr> |
| 5294 |
<tr><td></td><td valign="top"><a href="#index-Overview-mode-of-numdiff">Overview mode of numdiff</a>:</td><td> </td><td valign="top"><a href="#Overview-mode">Overview mode</a></td></tr> |
| 5295 |
<tr><td colspan="4"> <hr></td></tr> |
| 5296 |
<tr><th><a name="Index_cp_letter-P">P</a></th><td></td><td></td></tr> |
| 5297 |
<tr><td></td><td valign="top"><a href="#index-Predefined-settings-of-numdiff">Predefined settings of numdiff</a>:</td><td> </td><td valign="top"><a href="#Invoking-numdiff">Invoking numdiff</a></td></tr> |
| 5298 |
<tr><td></td><td valign="top"><a href="#index-Purposes">Purposes</a>:</td><td> </td><td valign="top"><a href="#Overview">Overview</a></td></tr> |
| 5299 |
<tr><td colspan="4"> <hr></td></tr> |
| 5300 |
<tr><th><a name="Index_cp_letter-R">R</a></th><td></td><td></td></tr> |
| 5301 |
<tr><td></td><td valign="top"><a href="#index-Raw-output-format">Raw output format</a>:</td><td> </td><td valign="top"><a href="#Raw-output">Raw output</a></td></tr> |
| 5302 |
<tr><td colspan="4"> <hr></td></tr> |
| 5303 |
<tr><th><a name="Index_cp_letter-S">S</a></th><td></td><td></td></tr> |
| 5304 |
<tr><td></td><td valign="top"><a href="#index-Side_002dby_002dside-report-_0028numdiff_0029">Side-by-side report (numdiff)</a>:</td><td> </td><td valign="top"><a href="#Overview-mode">Overview mode</a></td></tr> |
| 5305 |
<tr><td></td><td valign="top"><a href="#index-Synopsis-_0028ndselect_0029">Synopsis (ndselect)</a>:</td><td> </td><td valign="top"><a href="#Invoking-ndselect">Invoking ndselect</a></td></tr> |
| 5306 |
<tr><td></td><td valign="top"><a href="#index-Synopsis-_0028numdiff_0029">Synopsis (numdiff)</a>:</td><td> </td><td valign="top"><a href="#Invoking-numdiff">Invoking numdiff</a></td></tr> |
| 5307 |
<tr><td colspan="4"> <hr></td></tr> |
| 5308 |
<tr><th><a name="Index_cp_letter-T">T</a></th><td></td><td></td></tr> |
| 5309 |
<tr><td></td><td valign="top"><a href="#index-Thanks">Thanks</a>:</td><td> </td><td valign="top"><a href="#Acknowledgments">Acknowledgments</a></td></tr> |
| 5310 |
<tr><td></td><td valign="top"><a href="#index-Tools">Tools</a>:</td><td> </td><td valign="top"><a href="#ndselect">ndselect</a></td></tr> |
| 5311 |
<tr><td colspan="4"> <hr></td></tr> |
| 5312 |
<tr><th><a name="Index_cp_letter-U">U</a></th><td></td><td></td></tr> |
| 5313 |
<tr><td></td><td valign="top"><a href="#index-Usage-of-numdiff">Usage of numdiff</a>:</td><td> </td><td valign="top"><a href="#Overview">Overview</a></td></tr> |
| 5314 |
<tr><td colspan="4"> <hr></td></tr> |
| 5315 |
<tr><th><a name="Index_cp_letter-W">W</a></th><td></td><td></td></tr> |
| 5316 |
<tr><td></td><td valign="top"><a href="#index-Warnings">Warnings</a>:</td><td> </td><td valign="top"><a href="#Warnings">Warnings</a></td></tr> |
| 5317 |
<tr><td colspan="4"> <hr></td></tr> |
| 5318 |
</table> |
| 5319 |
<table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#Index_cp_letter-A"><b>A</b></a> |
| 5320 |
|
| 5321 |
<a class="summary-letter" href="#Index_cp_letter-B"><b>B</b></a> |
| 5322 |
|
| 5323 |
<a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a> |
| 5324 |
|
| 5325 |
<a class="summary-letter" href="#Index_cp_letter-D"><b>D</b></a> |
| 5326 |
|
| 5327 |
<a class="summary-letter" href="#Index_cp_letter-F"><b>F</b></a> |
| 5328 |
|
| 5329 |
<a class="summary-letter" href="#Index_cp_letter-G"><b>G</b></a> |
| 5330 |
|
| 5331 |
<a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a> |
| 5332 |
|
| 5333 |
<a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a> |
| 5334 |
|
| 5335 |
<a class="summary-letter" href="#Index_cp_letter-L"><b>L</b></a> |
| 5336 |
|
| 5337 |
<a class="summary-letter" href="#Index_cp_letter-N"><b>N</b></a> |
| 5338 |
|
| 5339 |
<a class="summary-letter" href="#Index_cp_letter-O"><b>O</b></a> |
| 5340 |
|
| 5341 |
<a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a> |
| 5342 |
|
| 5343 |
<a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a> |
| 5344 |
|
| 5345 |
<a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a> |
| 5346 |
|
| 5347 |
<a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a> |
| 5348 |
|
| 5349 |
<a class="summary-letter" href="#Index_cp_letter-U"><b>U</b></a> |
| 5350 |
|
| 5351 |
<a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a> |
| 5352 |
|
| 5353 |
</td></tr></table> |
| 5354 |
|
| 5355 |
<div class="footnote"> |
| 5356 |
<hr> |
| 5357 |
<h4 class="footnotes-heading">Footnotes</h4> |
| 5358 |
|
| 5359 |
<h3><a name="FOOT1" href="#DOCF1">(1)</a></h3> |
| 5360 |
<p>By major numerical differences and major errors |
| 5361 |
I mean those ones listed in the output of <code>numdiff</code> if none |
| 5362 |
of the options <samp>-U</samp>, <samp>-f</samp>, <samp>-O</samp>, and <samp>-q</samp> is used.</p> |
| 5363 |
</div> |
| 5364 |
<hr> |
| 5365 |
|
| 5366 |
|
| 5367 |
|
| 5368 |
</body> |
| 5369 |
</html> |