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 X-Google-Thread: 103376,b34ecb04700058dd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-12 12:16:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: how to parse words from a string Date: 12 Nov 2002 20:16:12 +0000 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1037132168 29472 62.49.19.209 (12 Nov 2002 20:16:08 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 12 Nov 2002 20:16:08 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:30779 Date: 2002-11-12T20:16:12+00:00 List-Id: mabes180@aol.com (Sarah Thomas) writes: > i'm new to ada, could someone help me with the following: > i need to read in an input file and parse each line word by word. > I read in each line of text, but now i need to extract the words > (separated by tabs) into an array, how do i do that...would appreciate > some suggestions, thanks Finding the words .. obviously you're going to start with two indexes into the line (start of word, end of word) set to the beginning of the line and loop, incrementing the end of word variable, until you find the end of the word. Extracting the words .. do you know about slices? Line (First .. Last) is a substring of the line. Storing the words .. you'll need varying length "strings", check out Ada.Strings.Unbounded.