Re: AWK-Editing files in "place" and a --write switch
- From: gazelle@xxxxxxxxxxxxxxxxxx (Kenny McCormack)
- Date: Sun, 14 Sep 2008 15:51:42 +0000 (UTC)
In article <00e23435-3bae-49f4-ba46-c84876b4c511@xxxxxxxxxxxxxxxxxxxxxxxxxx>,
<rubin1001@xxxxxxxxx> wrote:
Trying to construct a convenient awk option similar to sed -i, I?m
using the following code(s) used as
functions, to edit the file(s) in "place":
If I understand you correctly, your "reason for posting" is that you've
hacked up a "script kludge" way of doing what you want, and are now asking
the maintainers if they would consider implementing this functionality
in the "core" (i.e., in the C source code). Is that correct?
The previous paragraph is _my_ "reason for posting", but I might as well
add a comment or two about the general idea:
1) As far as I'm concerned, the "right way" to do this (*) is to
store up the results in an array, then, in the END block,
dump the array out to the file:
close(FILENAME)
for (i=1; i<=n; i++) print myarray[i] > FILENAME
2) Regarding getting it changed in the source: My guess is that
you'll have better luck going ahead and doing it yourself
(it shouldn't be very difficult) than in getting the
maintainers to do it.
(*) I do this rarely, but in some isolated situations, it has seemed
warranted.
.
- References:
- AWK-Editing files in "place" and a --write switch
- From: rubin1001
- AWK-Editing files in "place" and a --write switch
- Prev by Date: AWK-Editing files in "place" and a --write switch
- Next by Date: Re: Splitting a string into characters portably - AWK BUG!
- Previous by thread: AWK-Editing files in "place" and a --write switch
- Next by thread: Re: AWK-Editing files in "place" and a --write switch
- Index(es):
Relevant Pages
|