New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Shell Script Address Book


Post Reply New Thread Subscribe

 
Thread Tools
Mbengi Bongi

 
Member Since: Dec 16, 2006
Posts: 25
Mbengi Bongi is on a distinguished road

Mbengi Bongi is offline
Can anyone help a scripting Noobie with shell script I'm trying to compile?

He wants to create a script which is basically an address book, all his data in in a text file (I think its in csv format, so we'll assusme it is).

He basically wants to enter the contacts surname (which is the data in the 1st culumn of the file) and he wants the script then to check to see if the 2nd column says either 'Business' or 'Personal' and then echo the fields in the remaining coulumns depending what was fould in column 2, so for example if 'Jones' was inputted and column 2 said 'Personal' the output would be:

Code:
Surname:  Jones
Forename: Ben
Birthday: 03/09
Mobile Number: 07000 000 000
Email: ben.jones(at)email.com
Address: 2 Any Street, Anytown, Anyshire, AN1 2AN
But if column 2 said 'Business' it would be:

Code:
Surname:  Jones
Forename: Ben
Position: Manager
Business Number: 07000 000 000
Business Email: ben.jones(at)company.com
Business Address: 2 Any Street, Anytown, Anyshire, AN1 2AN
I'm guessing awk or grep (or both) must be used?

Any help would be gratefully appreciated
QUOTE Thanks

Post Reply New Thread Subscribe


« How to make useful a non-native application in Mac OS X 10.5 | finding and installing indivdial libs »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Grouping contacts in Address Book like iPhone or iPod Touch automatically??? sirbOOm OS X - Operating System 0 12-01-2008 02:21 AM
address book plug in for X code xmax OS X - Apps and Games 0 07-14-2008 08:31 AM
iPhoto Book mathogre Images, Graphic Design, and Digital Photography 30 11-22-2007 01:42 PM
Address book problems DubeDude OS X - Operating System 6 03-18-2007 11:38 AM
Import Mac Address book Milwauken Running Windows (or anything else) on your Mac 6 09-15-2005 06:41 PM

All times are GMT -4. The time now is 09:19 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?