# awk script help

**URL:** <https://community.unix.com/t/awk-script-help/260119>\
**Category:** Shell Programming and Scripting\
**Created:** [February 19, 2010, 1:08pm UTC](https://community.unix.com/t/awk-script-help/260119 "2010-02-19T13:08:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Learnerabc](https://community.unix.com/letter_avatar/learnerabc/32/5_5575768a8748004e209b776fc1b2916d.png) [@Learnerabc](https://community.unix.com/u/Learnerabc)\
**Post date:** [February 19, 2010, 1:08pm UTC](https://community.unix.com/t/awk-script-help/260119/1 "2010-02-19T13:08:29Z")

</div>

Hi, I am new to Unix and need some help as I stuck on this problem..I will appreciate if someone can help me with this

Write awk.script that calculates which continent (Europe, Asia or America) has the largest population density based on the given input. America corresponds to two areas in the file, North and South. The script also produces the following output:

Based on countries.txt,continent with the largest population density is

Asia: population density = 866/1411 = 0.6137

Information in blue color was calculated based on the following countries.txt file (format is  
country square population area):  
Canada 3852 25 North  
USA 3615 237 North  
Brazil 3286 134 South  
India 1267 746 Asia  
Mexico 762 78 North  
France 211 55 Europe  
Japan 144 120 Asia  
Germany 96 61 Europe  
England 94 56 Europe

---

<div class="post-metadata">

**Author:** ![anbu23](https://community.unix.com/user_avatar/community.unix.com/anbu23/32/351_2.png) [@anbu23](https://community.unix.com/u/anbu23)\
**Post date:** [February 19, 2010, 1:22pm UTC](https://community.unix.com/t/awk-script-help/260119/2 "2010-02-19T13:22:27Z")

</div>

Home work??

---

<div class="post-metadata">

**Author:** ![Learnerabc](https://community.unix.com/letter_avatar/learnerabc/32/5_5575768a8748004e209b776fc1b2916d.png) [@Learnerabc](https://community.unix.com/u/Learnerabc)\
**Post date:** [February 19, 2010, 1:25pm UTC](https://community.unix.com/t/awk-script-help/260119/3 "2010-02-19T13:25:31Z")

</div>

not really a homework, but you can say that sir as these problems are also given by teacher.but I am stuck on this one. ☹

---

<div class="post-metadata">

**Author:** ![anbu23](https://community.unix.com/user_avatar/community.unix.com/anbu23/32/351_2.png) [@anbu23](https://community.unix.com/u/anbu23)\
**Post date:** [February 19, 2010, 1:35pm UTC](https://community.unix.com/t/awk-script-help/260119/4 "2010-02-19T13:35:11Z")

</div>

You should follow rules for posting homework  
[http://www.unix.com/homework-coursework-questions/113751-rules-homework-coursework-questions-forum.html](http://www.unix.com/homework-coursework-questions/113751-rules-homework-coursework-questions-forum.html)
