Hi!
sara MA schrieb:
> Hello:
>
> I do have a question which might be easy, but confused me....my problem is I
> don't know how to count columns, for example, in example below:
>
> (TTL=30) is column 18 or 15 or I should filter it another wa since it's
> between [ ]?
>
> s 1.000000000 _0_ RTR --- 0 AODV 48 [0 0 0 0] ------- [0:255 -1:255
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
> 30 0] [0x2 1 1 [2 0] [0 4]] (REQUEST)
16 17 18 19 20 21 22 23 24 25
If you are using awk each " " (space) or concatenation of spaces counts
as a separator. I think you can change what the separator is somehow but
I never did that. Anyway, this means that the "[" and "]" don't have
special meaning per se, so eg. "[0:255" is one column. As I count it
(hopefully the lines above are not reformattet) the 30 is in column 16
as columns are counted starting with 1, not 0.
Just make a short test file with, say, 10 lines or so and run awk on it
printing the columns you're interested in to get a feeling for it. eg.:
awk '{print $16}' testfile
then '{print $17}' testfile
etc.
Good luck,
Martina Umlauft