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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?B?QmrDtnJuIEx1bmRpbg==?= Newsgroups: comp.lang.ada Subject: Re: is there Ada package similar to Matlab textscan? Date: Fri, 17 Jul 2015 13:05:24 +0200 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 17 Jul 2015 11:02:43 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="5b7792bbfdd207fe5c19aea2206a9f76"; logging-data="21528"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/dgayFcHfU+JtGV6nEn0/w" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 In-Reply-To: Cancel-Lock: sha1:+19t23IjAlNfPdsF7OAhG3HFV9U= Xref: news.eternal-september.org comp.lang.ada:26841 Date: 2015-07-17T13:05:24+02:00 List-Id: On 2015-07-17 05:52, Nasser M. Abbasi wrote: > one parse each field one by one themselves after > reading the file line by line? Gnat.Awk is line based but parsing is simple: with GNAT; use GNAT; with GNAT.AWK; with Text_io; procedure Test is Computer_File : AWK.Session_Type; begin AWK.Set_Current (Computer_File); AWK.Open (Separators => ",", Filename => "path/to/file.dat"); while not AWK.End_Of_File loop AWK.Get_Line; if AWK.Field(4) = "GB" and then AWK.Field (18) = "PE" then Text_io.Put_Line(AWK.Field (5) & " | " & AWK.Field (8) & " | " & AWK.Field (2) & " | " & AWK.Field (11)); end if; end loop; AWK.Close (Computer_File); see for more examples -- -- Björn