From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.sun.com!news.sun.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 02 Oct 2008 07:56:59 -0500 Newsgroups: comp.lang.ada Subject: Re: Avoiding side effects References: From: Ole-Hjalmar Kristensen Organization: Sun Microsystems Date: 02 Oct 2008 14:56:58 +0200 Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cache-Post-Path: news1nwk!unknown@khepri42.norway.sun.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-KY0aNvmpJhdKCrRJ45R/biAFsPdqSiDm61wfL73eFzs58+EYZdzo4Orh9+D4yh2VTHo1lSKGAC4/oS0!Bgs1KOEoJBQoOhdHX6SAdYXka3YgZtpfpkkYoQYpwzGIj+zkuDkJt6Qs X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Xref: g2news1.google.com comp.lang.ada:2193 Date: 2008-10-02T14:56:58+02:00 List-Id: If I understand your problem correctly, why not simply do the following after the sort -u stage?: comm -23 fileA fileB But to answer the Ada quiestion, I think I would organize the loop a little bit differently. The following is a classical way of merging two files, but it should work in your case too: while not End_Of_File(File_A) and not End_Of_File(File_B) loop -- Process records from both files end loop; while not End_Of_File(File_A) loop -- Process tail of file A end loop; while not End_Of_File(File_B) loop -- Process tail of file B end loop; -- C++: The power, elegance and simplicity of a hand grenade.