In the future, please show us your entire awk script. The script you showed us is at least missing a closing } and you have not shown us how the awk variable n was set.
If I correctly understand what you're trying to do, maybe this will do what you want:
If you want to try this on a Solaris/SunOS system, change awk to /usr/xpg4/bin/awk or nawk.
With the sample input you provided, the above script produces the output:
I assume that the differences between the results shown above and the results you said you wanted are rounding differences.
This User Gave Thanks to Don Cragun For This Post:
Hi all,
Have a small problem.
Back in October the pervious sys-admin (of a client's company) made the necessary adjustments to the system clock for daylight savings (Sydney time - +11 GMT).
As far as I can gather, they just amended the time - NO TIMEZONE !?!
Is there an effective and safe... (5 Replies)
If I have a file like this, could anyone please guide me how to find the average value in each metrix. The file has got about 130,000 metrixs.
Grid-ref= 142, 235
178 182 203 240 273 295 289 293 283 262 201 176
167 187 187 246 260 282 299 312 293 276 230 191
169 ... (2 Replies)
Hi Friends,
Can any one help me with count average of student marks in this file (i can not change structure of the input file):
input file:
1 - student ID
2 - student name
3 - group ID
4 - teacher ID
5 - marks (numbers of marks are different)
1:John Smith:2:3:2 3 4 5
2:Mark... (1 Reply)
Hi,
I'm thinking of running a script via cron (every hour) to do the log rolling.
The file is "file.txt" and there going to be 10 files rolling (file.txt.n).
The file is being written constantly by an application.
The script will do the following:
1. cat file.txt > file.txt.0
2. cat... (0 Replies)
I am writing a software product and hope that it will work on a variety of Linux distributions. At the moment, I am trying to create some kind of Linux version of patches/upgrades of installed software. Gathering information on available updates isn't hard, nor is installation of updates, but I... (27 Replies)
Can some one help me related to .sql file issue.
I have a .sqlfile and tried to read the file thru unix. In the .sqlfile I have error rows as well and when error comes I dont want to proceed further and need to roll back all the transactions.
sample .sql file below
insert into
test... (2 Replies)
I want to get CPU average value only (not required user CPU & memory) with each hours on individual date. The sample output is below
| | | User |Memory| User |
Date | Time |CPU %|CPU % | % |Mem % |
03/02/2015|00:00:00| 24.56| 20.66| 89.75| 63.48|... (13 Replies)
How to calculate percentage non zero value occurrence base on value col 1 and 2
2017 a 0
2017 a 2
2017 a 4
2017 a 2
2017 a 0
2017 b 2
2017 b 6
2016 a 2
2016 a 2
2016 b 2
2016 b 8
2016 b 0
2016 b 0
2016 c 2
2016 c 2
2016 c 0
i manage to get average
# awk '{A++;B+=$3}END{for(X in... (1 Reply)
Discussion started by: before4
1 Replies
LEARN ABOUT DEBIAN
input
INPUT(5) File Formats Manual INPUT(5)NAME
input - input data file format
DESCRIPTION
This manual page describes the output format of the file created by the Yagi-Uda project input or first programs. The file is an ASCII
file, so can be edited manually if required. It is read by yagi or optimise. The program optimise also creates the same file format.
NOTES
FREQUENCY
MIN_FREQUENCY
MAX_FREQUENCY
STEP_FREQUENCY
ELEMENTS
DRIVEN
PARASITIC
ANGULAR_STEP
DATA_DRIVEN
DATA_PARASITIC
The
#
is used as a comment.
A typical file, for an antenna designed for the 2m amateur band (144-146
MHz) might be as shown below. Note:
1) Reflector is at position 0.0
2) All elements lengths/positions are in m.
NOTES This line can be up to 400 characters.
FREQUENCY 145.000000
MIN_FREQUENCY 144.000000
MAX_FREQUENCY 146.000000
STEP_FREQUENCY 0.100000
ELEMENTS 10
DRIVEN 1
PARASITIC 9
ANGULAR_STEP 180.000000
#DATA_DRIVEN x y length diameter voltage phase
DATA_DRIVEN 0.30993 0.000000 1.002492 0.0063000000000000 1.000000 0.000000
# DATA_PARASITIC x y length diameter
DATA_PARASITIC
0.00000 0.00000 1.01902 0.00630
0.49859 0.00000 0.95551 0.00630
1.07338 0.00000 0.93595 0.00630
1.81020 0.00000 0.92050 0.00630
2.58152 0.00000 0.91322 0.00630
3.30390 0.00000 0.91243 0.00630
4.03692 0.00000 0.90423 0.00630
4.64108 0.00000 0.89081 0.00630
5.37418 0.00000 0.83912 0.00630
FILES
filename ASCII description of antenna. filename.out binary file
SEE ALSO yagi(1), output(1), input(1), optimise(1), first(1) and yagi(5).
AUTHORS
Dr. David Kirkby G8WRB (david.kirkby@onetel.net), with help with converting to DOS from Dr. Joe Mack NA3T (mack@fcrfv2.ncifcrf.gov).
Yagi version 1.16 24th October 2000 INPUT(5)