Visit Our UNIX and Linux User Community


Awk Programing (need help)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Awk Programing (need help)
# 1  
Old 03-05-2008
Awk Programing (need help)

plx help to solve these problems??

1. Create a HERE document which will edit multiple files in the same directory, using the ed editor. I give you 3 original files: file1.c , file2.c , file3.c, download them and change each string "stdio.h" to "STDIO.H" in these files. Note: when execute the shell file, you should change all of C files. You do not need execute it several times. Only Submit the shell script file and result files.
2. Consider the file normal.precip.txt. It contains the average amount of rainfall over a 30 year period for about 275 cities in North America. The first line of the file is a header, which tells you what each column contains. Basically, each line contains a city name, the state the city is in, and then average rainfall amounts from January through December, and then an annual average for all months. The file is TAB delimited. QUESTION: What is the total average amount of rainfall, in inches, for the month of January, for the following states: California (CA), Texas (TX), Alaska (AK). I want individual totalized averages for each of the above states for the month of January. As a check on your algorithm, note that the totalized average rainfall for California (CA) for the month of February over the same period was 2.65067. This was derived by adding the rainfall values together for all cities in California for the month of February, and simply taking their average.
Please use Awk programming to implement above procedure.
# 2  
Old 03-05-2008
Please read the Rules of these forums - no homework.
Thread closed.

Previous Thread | Next Thread
Test Your Knowledge in Computers #183
Difficulty: Easy
Over 40% of UNIX.com users voted that bash was their most useful shell.
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Doubt in awk programing

i wrote an awk progarm to calculate throughput from a ns2 trace file. i want this program to act on multiple trace files and it should display each output in a single output file can anyone please clear my doubt i tried with awk -f awkscript inputfile1... (7 Replies)
Discussion started by: sarathyy
7 Replies

2. Programming

Unicode programing in C

im starting to go a little serious with c, woking in a personal project that will read a xml, which might contain Unicode characters (i know it will on my system, which is set to es_AR.UTF-8) im using mxml, and the documentation says it uses utf8 internally (no worries here). so i need to be... (4 Replies)
Discussion started by: broli
4 Replies

3. IP Networking

Netork programing

Hello experts, please help me as i want to learn the networking concepts in details , as i come know Unix network programming by Richard Stevens volume 1,2 is good please any of you downloaded the Free PDF version of it please direct m e as i want to download these books or the pdf form of it,... (1 Reply)
Discussion started by: vin_pll
1 Replies

4. Shell Programming and Scripting

Shell Programing with awk Tool

I'm working on a program in with shell programming and it needs to be able to delete the contents of files in the Home directory on certain days of the week.(like tuesday). Can anyone help me with this? Thanks in advance, Taffy. (7 Replies)
Discussion started by: Taffy
7 Replies

5. Shell Programming and Scripting

shell programing...

Hi... i need to write a shell script wich shows the full name and station of every logged user in the system. pls help! (1 Reply)
Discussion started by: relu89
1 Replies

6. Programming

A C++ programing Shell on Win

Hello I need to translade the power of unix command shell (grep, sed, awk, wc, etc..) to windows. In my work every day I administrate 15 unix server ans 18 windows server, and I have the problem the absolutly limitation of windows shell. Im a system administrator but I know programming. I... (2 Replies)
Discussion started by: dalmus
2 Replies

7. HP-UX

crontab programing

How can program at crontab dayly each 30 minut (2 Replies)
Discussion started by: petroleo
2 Replies

8. Programming

Win programing

I am having a windows and i would like to know whitch program do you prefer for programing in windows P.S. C++ (1 Reply)
Discussion started by: D.Borak
1 Replies

9. UNIX Desktop Questions & Answers

Graphics programing

Hi all! I`m new in Unix (Linux) and i whant to ask something! What language should i use for Linux developing.I meen applications an GAME DEVELOPING! Should i use C,TCL ??? Please help me on this ...:( (1 Reply)
Discussion started by: Sebastyan
1 Replies

Featured Tech Videos