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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a6b:f807:: with SMTP id o7-v6mr8182301ioh.25.1542512697916; Sat, 17 Nov 2018 19:44:57 -0800 (PST) X-Received: by 2002:aca:4eca:: with SMTP id c193mr103076oib.7.1542512697819; Sat, 17 Nov 2018 19:44:57 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!feeder3.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!g188-v6no2095515itg.0!news-out.google.com!y103-v6ni2602ita.0!nntp.google.com!g188-v6no2095514itg.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 17 Nov 2018 19:44:57 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=146.5.17.97; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 146.5.17.97 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <93200914-ef2d-4cb1-8b45-76819db2a8e0@googlegroups.com> Subject: Re: Text IO for files not using the standard line termination for the OS From: Shark8 Injection-Date: Sun, 18 Nov 2018 03:44:57 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:54838 Date: 2018-11-17T19:44:57-08:00 List-Id: On Saturday, November 17, 2018 at 7:01:45 PM UTC-7, jdgre...@hotmail.com wrote: > I use Ada 2012 to write Windows programs; my usual compiler is 32-bit TDM-gcc which implements the gcc-5.1.0 version of the Ada compiler. > > My problem is a simple one: i need to produce a program which reads lines from a text file; if a line meets a requirement, it is written to an output file; if it does not meet the requirement it is not written to the output file. > > The annoyance that I must deal with is the fact that the files are not Windows text files, which use the convention to terminate text lines. > > The files use a single as the line terminator. > > Is there a way to get Ada.Text_IO to use a line terminator that is not the default for the operation system on which the program runs? I think you have to do it character-by-character in this case. There's a library called PragmaARC (IIRC) that has Text_IO packages for non-native text, you might want to take a look there.