DOCUMENT:Q104731 17-DEC-2000 [msdos] TITLE :SORT Adds Extra Character to Sorted Output PRODUCT :Microsoft Disk Operating System PROD/VER:MS-DOS:5.x,6.0,6.2,6.21,6.22 OPER/SYS: KEYWORDS: ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft MS-DOS operating system versions 5.0, 5.0a, 6.0, 6.2, 6.21, 6.22 ------------------------------------------------------------------------------- SUMMARY ======= SORT adds an extra character to the end of the file being sorted if an end-of-file (EOF) or carriage return () character is missing from the end of the file. MORE INFORMATION ================ Some text editors don't automatically add a or EOF character to the end of the file (unlike MS-DOS Edit). If you use this type of editor and your file doesn't have a trailing or EOF character, your sorted file contains an extra character. For example, if you sort the following file (which does not have an EOF or character at the end of the file) AA BB CC AA with the command SORT < TEXT.TXT > TESTOUT.TXT, your sorted output is AA AAx BB CC where x is a random character from memory. RESOLUTION ========== To work around this problem, edit the file you want to sort and add a to the end. STATUS ====== Microsoft has confirmed this to be a problem in MS-DOS versions 5.x, 6.0, 6.2, and 6.21. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. Additional query words: 6.22 5.00 5.00a 6.00 6.20 garbage extended ASCII corrupt corrupted symbol ====================================================================== Keywords : Technology : kbMSDOSSearch kbMSDOS621 kbMSDOS622 kbMSDOS620 kbMSDOS600 kbMSDOS500 kbMSDOS500a Version : MS-DOS:5.x,6.0,6.2,6.21,6.22 ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 2000.