comp.lang.ada
 help / color / mirror / Atom feed
* Modifying a file
@ 2003-07-29 11:36 Daniel Allex
  2003-07-29 12:02 ` Bobby D. Bryant
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Allex @ 2003-07-29 11:36 UTC (permalink / raw)


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?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Modifying a file
  2003-07-29 11:36 Modifying a file Daniel Allex
@ 2003-07-29 12:02 ` Bobby D. Bryant
  2003-07-29 14:23   ` Stephen Leake
  0 siblings, 1 reply; 3+ messages in thread
From: Bobby D. Bryant @ 2003-07-29 12:02 UTC (permalink / raw)


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?

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
and what operating system it is on.

-- 
Bobby Bryant
Austin, Texas




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Modifying a file
  2003-07-29 12:02 ` Bobby D. Bryant
@ 2003-07-29 14:23   ` Stephen Leake
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Leake @ 2003-07-29 14:23 UTC (permalink / raw)


"Bobby D. Bryant" <bdbryant@mail.utexas.edu> 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-07-29 14:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-29 11:36 Modifying a file Daniel Allex
2003-07-29 12:02 ` Bobby D. Bryant
2003-07-29 14:23   ` Stephen Leake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox