Re: moving data from one place to another in a text file
From: Richard (riplin_at_Azonic.co.nz)
Date: 02/18/05
- Next message: Richard: "Re: Compiler for old Linux"
- Previous message: James J. Gavan: "Re: May I introduce myself to cobol?..."
- In reply to: Lueko Willms: "Re: moving data from one place to another in a text file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 18 Feb 2005 10:24:48 -0800
> Otherwise it might be better to copy the ...
In my view the simpler the program the 'better' it is. Copying the
file, or parts of it, somewhere else: a temporary file or some
in-memory structure; just complexifies the program and gives more
points where it may be miscoded, or could go wrong.
I doubt that using a temporary file would make the program use less
resources overall (which may be why you thought it 'better'). Reading
the input twice, especially as it is likely to be cached for the 2nd
pass, is probably much faster than opening a new temporary file to be
written and read back for part of the data.
> The best solution might be to tell the manager to supply the two
> records to be inserted separately.
Which could be easily achieved by having the code you quoted as a
separate program and added to by writing a and b to a new file.
That would qualify in my view as 'better' because we now have two
programs but each is simpler.
- Next message: Richard: "Re: Compiler for old Linux"
- Previous message: James J. Gavan: "Re: May I introduce myself to cobol?..."
- In reply to: Lueko Willms: "Re: moving data from one place to another in a text file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|