The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: array problem
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-09-2007
shary shary is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 61
array problem

Dear Experts,

please help me out once again my array concepts is not very clear i have one text file like.
1|usa|hh
2|usa|ll
3|usa|vg
4|uk|nn
5|uk|bb
6|kuwait|mm
6|kuwait|jkj
7|dubai|hh

i want to store the third fied of a text file in he array and after that it should give me some reports like this

third field count
usa 3
uk 2
kuwait 2
dubai 1
it should store the third field in to the array and give me the count how many times any name appeared.the third field can be alphanumeric.
please can any body tell me how to do this using array.

Regards,
Shary