Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are two main causes for uniq failing to merge identical lines:</p> <ul> <li><p>The lines are not really identical - extra trailing whitespace is a usual suspect here. The awk commands should filter those in this example, but you can check that anyway. Mixed-up line terminators are also a possible cause.</p></li> <li><p>The lines are not adjacent - sort can and will fail to sort lines "properly" if the locale settings are incorrect. I <em>have</em> seen weird cases with non-ASCII text where identical lines will not end up one after the other. Check the output of sort, before the uniq command. What are your locale settings?</p></li> </ul> <p>BTW, 'sort -u' is a better alternative for 'sort | uniq'.</p> <p>EDIT:</p> <p>Seems like one or both of these issues:</p> <ul> <li><p>You have mixed line-terminators. If some of your lines end up in LF (\n, Unix style terminators) and some in CR/LF (\r\n, DOS-style terminators), uniq will treat them as different lines, even if they are otherwise identical.</p></li> <li><p>Trailing whitespace in some of your lines along with CR/LF DOS-style line terminators. The CR (Carriage return, '\r') character is not considered whitespace by most (all?) unix utilities, including awk. If one of your lines does not have any other trailing whitespace, the CR will be considered part of its last field and be printed out. On the other hand, in a line with whitespace between the last field and the CR, the last field as printed by awk would not contain the CR.</p></li> </ul> <p>Changing the CR/LF line terminator to LF will solve both issues in this case, although it's generally best to filter trailing whitespace as well:</p> <ul> <li>dos2unix is the preferred way</li> <li>As an alternative, filter your file through <code>sed 's|\r$||'</code></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload