C
clearguy02
Hi all,
I have this text file with columns (entries seperated by a tab);
++++++++++++++++++++++
Alabama John
Alabama Victor
California Raj
California Jason
California Lucy
Michigan Peter
++++++++++++++++++++++
Now I want to know how many people are in each state.
The output should be as follows (seperated by tabs).
+++++++++++++++++++++
Alabama 2 1.John
2.Victor
California 3 1. Raj
2. Jason
3. Lucy
Michigan 1 1. Peter
++++++++++++++++++++++
I am try the following, but I am confused with the hash processing after splitting each row in to two values. Can some one help me out here?
+++++++++++++++++++++
while (<DATA>)
{
($state, $name) = split (\t, $_);
...
....
}
__DATA__
Alabama John
Alabama Victor
California Raj
California Jason
California Lucy
Michigan Peter
I have this text file with columns (entries seperated by a tab);
++++++++++++++++++++++
Alabama John
Alabama Victor
California Raj
California Jason
California Lucy
Michigan Peter
++++++++++++++++++++++
Now I want to know how many people are in each state.
The output should be as follows (seperated by tabs).
+++++++++++++++++++++
Alabama 2 1.John
2.Victor
California 3 1. Raj
2. Jason
3. Lucy
Michigan 1 1. Peter
++++++++++++++++++++++
I am try the following, but I am confused with the hash processing after splitting each row in to two values. Can some one help me out here?
+++++++++++++++++++++
while (<DATA>)
{
($state, $name) = split (\t, $_);
...
....
}
__DATA__
Alabama John
Alabama Victor
California Raj
California Jason
California Lucy
Michigan Peter