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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7fc767abbf17c947 X-Google-Attributes: gid103376,public From: Dale Stanbrough Subject: Re: Parsing a line into strings Date: 1998/07/09 Message-ID: <6o167q$d3t$1@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 369724873 Distribution: world Content-Transfer-Encoding: 8bit References: <35A3A199.D55C3153@oit.edu> Content-Type: text/plain; charset=ISO-8859-1 X-XXMessage-ID: Organization: RMIT Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-07-09T00:00:00+00:00 List-Id: "If you're using GNAT, the package GNAT.Spitbol has such a feature." Spitbol is a rather large hammer to crack a rather small nut. I have a package that will do what you want to do. It is at... http://www.cs.rmit.edu.au/~dale/software/index.html >From the package spec... function Select_Field ( Item : String; Field_No : Integer; Field_Separator : Character) return String; -- Returns a string that represents the nth string in the field. -- The 'first of the return string is always set to one -- Fields are separated by the supplied character -- E.g. -- -- Field ("cat:dog:mouse", 3, ':') -- -- would result in the string -- -- "mouse" -- -- A -ve value indicates searching from the RHS. -- -- E.g. -- -- Field ("cat:dog:mouse", -1, ':') -- -- would result in the string -- "mouse" Dale