|
From: | Jean-Michel ELYN |
Subject: | Re: New built-in variable |
Date: | Tue, 16 Dec 2008 10:01:13 +0100 |
User-agent: | Thunderbird 2.0.0.16 (X11/20080723) |
Hello Aharon,First, I want to thank you for your detailed answer. Now I understand a bit how awk command works. I now know my request has been listened to, what the result will be. However, I would like to provide some additional details about what I would like, I'm not sure you have understood what I'm looking for because English is not my mother tongue.
So, I wrote I would like you to create a new built-in variable, FIELDS. This is not absolutely correct and it is obviously a not negligible cost. To be more precise, I would like a reference to the record, not a new variable. It would be great accessing $1, $2... as FIELDS[1], FIELDS[2]... so that calling awk functions using array(s) would be possible with direct access to current record, such as asort() or match(). This way no additional memory to allocate, just a new way to refer fields... as long as $1, $2... are actually created as an array. To tell it another way, $1 and FIELDS[1] would access the same memory block. The only difference is it would be possible to refer to the whole array as FIELDS. No way to do that with $i.
But maybe I'm using a wrong word: "new built-in variable" is not appropriate. It would be better saying "new way of referring fields of current record as an array". I hope I've been clearer this time.
Jean-Michel.PS: Don't know how to post this mail in the thread I've started. I'm afraid of creating a new thread as simply sending it to address@hidden Sorry if I've mistaken.
[Prev in Thread] | Current Thread | [Next in Thread] |