Sponsored Content
Full Discussion: Help with Unix commands
Operating Systems Linux Fedora Help with Unix commands Post 302470680 by tina_2010 on Wednesday 10th of November 2010 08:22:14 PM
Old 11-10-2010
Help with Unix commands

Hi, I have the following file called addresses, (it is a large file i have only copy and pasted few of the data below) and I am wanting to write a command so it will Find the ratio of mobile (07....) to land line (01....) telephone numbers?

then find the most popular first name and list the telephone numbers of everyone with that name.
sample data:

Richard:Richards:88 Birch Grove:01264290192
Jenny:Taylor:217 Victoria Place:07337349573
Jim:Jones:337 Wilmslow Road:07404751140
Richard:Richards:88 Birch Grove:01264290192
Jenny:Taylor:217 Victoria Place:07337349573
Jim:Jones:337 Wilmslow Road:07404751140

If anyone could help me, would be a great help, thank you
Image

---------- Post updated at 08:22 PM ---------- Previous update was at 08:15 PM ----------

I have got this far with the first part of my question, but obv that out puts every entry individually and doesnt give me a ratio style output (eg.35:30)

this is what i got :
awk -F':' '{count[$4]++}END{for(j in count) print j ":" j, "("count[j]")"}' addresses
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix Commands

Where can I get a list of basic commands ? I want to get up to speed as soon as possible ? thanks..... (4 Replies)
Discussion started by: drukkie
4 Replies

2. UNIX for Dummies Questions & Answers

Maingrame to UNIX sending UNIX commands

I want to know if there is a way to send unix commands thru FTP from a mainframe to kick off Autosys Jobs. I just need to send a command from the mainframe to UNIX and have UNIX execute that command. (2 Replies)
Discussion started by: skammer
2 Replies

3. UNIX for Dummies Questions & Answers

Unix Commands?

I would be happy to streamline some of the commands I am trying to learn with easy to remember terms, like dir for ls -l. I am wondering if you script certain commands for every time you start-up your system, can use those aliases there? If so, would that prove a problem for administrators who... (2 Replies)
Discussion started by: wmosley2
2 Replies

4. HP-UX

Unix Commands

HP 9000/800 Server running HP-UX UNIX Server, users are connected via LAN and dialup connection. Need help to write SHELL SCRIPT or UNIX Commands which would perform the following: -ping IP address of all login/connected users to our server -send customized text message to all the login... (1 Reply)
Discussion started by: Moinul Haque
1 Replies

5. UNIX Desktop Questions & Answers

Unix commands

What is the unix command that will display the current UTC time, hours, and minutes only. What is the unix command for sorting in descending order. What is the unix command for display the first 10 characters in a file. (4 Replies)
Discussion started by: charlton
4 Replies

6. UNIX for Dummies Questions & Answers

Running UNIX commands remotely in Windows box from Unix box – avoid entering password

I am able to run the UNIX commands in a Windows box from a UNIX box through "SSH" functionality. But whenever the SSH connection is established between UNIX and Windows, password for windows box is being asked. Is there a way to avoid asking password whenever the SSH connection is made? Can I... (1 Reply)
Discussion started by: D.kalpana
1 Replies

7. UNIX for Dummies Questions & Answers

unix commands...

i want to know how to do a few things using unix commands. firstly say I have a .txt file that contains random lines like Hello Goodbye I'm tired 5 74 using the grep command how can I get a list of lines that contain ONLY digits? also using pipes to combine ls and grep commands how... (5 Replies)
Discussion started by: ez45
5 Replies

8. UNIX for Dummies Questions & Answers

ALL unix commands

Hello Folks Where can I find all the unix commands with explanations , on the internet. I am searching but most of the sites are listing a few of the important ones. PLease guide through thanks (4 Replies)
Discussion started by: supercops
4 Replies

9. UNIX for Dummies Questions & Answers

$ commands in unix

What are the various commands which use $ in unix and what do each of these indicate? eg: echo $? returns the success status of the previous commands..similarly $$ returns some numeric value..wat exactly are these? From where can a download a document which can help me getting more details about... (2 Replies)
Discussion started by: DDS
2 Replies

10. UNIX for Dummies Questions & Answers

Unix Commands help

Having trouble doing the following things, I know it has something to do with using metacharacters but I'm not able to get it working correctly. I need a command to get a long directory listing of all the files that have: exactly two characters following the letters zot. all files that... (1 Reply)
Discussion started by: lakers34kb
1 Replies
Data::Grove::Parent(3)					User Contributed Perl Documentation				    Data::Grove::Parent(3)

NAME
Data::Grove::Parent - provide parent properties to Data::Grove objects SYNOPSIS
use Data::Grove::Parent; $root = $object->root; $rootpath = $object->rootpath; $tied = $object->add_magic([ $parent ]); $node = Data::Grove::Parent->new($hash [, $parent]); $node_list = Data::Grove::ParentList->new($array [, $parent]); DESCRIPTION
Data::Grove::Parent is an extension to Data::Grove that adds `"Parent"' and `"Raw"' properties to Data::Grove objects and methods for returning the root node of a grove, a list of nodes between and including the root node and the current node, and a method that creates parented nodes. Data::Grove::Parent works by creating a Perl ``tied'' object that contains a parent reference (`"Parent"') and a reference to the original Data::Grove object (`"Raw"'). Tying-magic is used so that every time you reference the Data::Grove::Parent object it actually references the underlying raw object. When you retrieve a list or a property of the Raw object, Data::Grove::Parent automatically adds magic to the returned list or node. This means you only call `add_magic()' once to create the first Data::Grove::Parent object and then use the grove objects like you normally would. The most obvious use of this is so you don't have to call a `"delete"' method when you want to release a grove or part of a grove; since Data::Grove and Data::Grove::Parent objects have no cyclic references, Perl can garbage collect them normally. A secondary use is to allow you to reuse grove or property set fragments in multiple trees. WARNING: Data::Grove currently does not protect you from creating your own cyclic references! This could lead to infinite loops if you don't take care to avoid them. METHODS
$object->root() $object->rootpath() `"root()"' returns the root node if `$object' is a `"Data::Grove::Parent"' object. `"rootpath()"' returns an array of all the nodes between and including the root node and `$object'. $tied = $object->add_magic([ $parent ]) `"add_magic()"' returns a "Data::Grove::Parent" object with `$object' as it's `"Raw"' object. If `$parent' is given, that becomes the tied object's parent object. AUTHOR
Ken MacLeod, ken@bitsko.slc.ut.us SEE ALSO
perl(1), Data::Grove(3) perl v5.16.3 2003-10-21 Data::Grove::Parent(3)
All times are GMT -4. The time now is 03:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy