AWK problem

im working on this file with awk and i need to input some number say 1 to 5 e.g
ID
1
2
3
4
5
ID
1
2
3
4
5
but only after my command from awk.

ive outputted the id from my file but cant get 1 to 5 listed this way

Thankyou for your help in advanced

Can anyone help

:confused:

Can you give more information? What's in the file? Are you writing a script? (if so, in what shell?) What's the OS and version?

If you are trying to input manually from a script, check the man page on the read command.

If you are trying to get those numbers into a file echo "1" >> filename ; echo "2" >> filename...(check man page on a loop function like for or while)

basically i have a file with test result from an experiment each test has 5 results and they each have different properties that i want outputted on the same line.

The thing is i can output the experiment ids ok

id1
id2
id3
id4
id5

but cant get the 5 results underneath each id.

Im using unix and am writing the script in a bourne shell.

You will need to post the script (or the portions dealing with the problem).

5 Staff doing 5 experiments im going to obtain the average for each member of staff

96000222 id
01 10
02 10
03 10
04 6
05 8
06 8
average = ?
96000124 id
01 8
02 11
03 2
04 0
05 0
06 0
average = ?
96000321 id
01 0
02 5
03 4
04 6
05 4
06 14
average = ?
96000123 id
01 10
02 2
03 2
04 9
05 8
06 5
average = ?
ect

The end result i would like would be their name followed by an average mark

staff1 average_mark
staff2 average_mark
staff3 average_mark
staff4 average_mark
staff5 average_mark

sorry for the confusion hope this helps:D

So where is the script?

(Does this seem like a course problem to any of you? I get the feeling someone is wanting me to write their script for them.)

I think possibly so... If the poster has a script, and posts it looking for someone to help troubleshoot, I would, but I wouldn't post example code in this case, unless it was very general.

It does look like a course problem, in fact it looks just like one that i am current doin

Take a peek:
http://www.shu.ac.uk/schools/cms/teaching/ps/unix/ass2.txt

One of the things I noticed in that assignment was this:

Thank you, clar2242. This does look suspiciously similar.

jeffersno1, please look here:
http://www.unix.com/showthread.php?s=&threadid=79
Look at number 6.