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,81e27809a2922767 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-29 07:39:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Modifying a file Date: 29 Jul 2003 10:23:51 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <686be06c.0307290336.13777c7e@posting.google.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1059488708 10947 128.183.235.92 (29 Jul 2003 14:25:08 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 29 Jul 2003 14:25:08 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Xref: archiver1.google.com comp.lang.ada:40952 Date: 2003-07-29T14:25:08+00:00 List-Id: "Bobby D. Bryant" writes: > On Tue, 29 Jul 2003 04:36:58 -0700, Daniel Allex wrote: > > > I have a file that is 13 lines long and I want to change the values of > > the last 5 lines. What's the best way to do this? Read in the whole file to an unconstrained array of an appropriate type, change the data, write out a new file with the same name. If you want a more detailed answer, you'll have to provide more info. Note that this sounds like a homework problem; we don't do people's homework for them. > If it's a source file or data file you probably want to use a text editor > or language sensitive editor such as vi, emacs, and many others. > > You could get more detailed suggestions if you said what was in the file Definitely necessary information. > and what operating system it is on. Part of the point of Ada's various file operations is to be OS independent, so we _shouldn't_ need this information unless it turns out that the standard Ada facilities can't do what they need. -- -- Stephe