Purchase Solution

Demonstration and explanation of unix "cut" command

Not what you're looking for?

Ask Custom Question

If I have a database record in the following format

name:address:city:state:phone

Notice each entry is separated by a :

I need to be able to use the cut command to grab each field and using command substitution be able to assign them to their own variables.

For example:
If I have the following record:

George:2345 Gway:Jville:FL:1231231234

How would I assign George to a name variable?
How would I assign 2345 to an address variable and so on?

Purchase this Solution

Solution Summary

This solution shows how to use the "cut" command and explains how it works.

Solution Preview

The "cut" command is a simple way to split a line of data apart when
all of the data on that line is delimited by a common delimiter. In
the posting the delimeter is ":". The general syntax of the cut
command is:

cut -d <d> -f <f> ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Javscript Basics

Quiz on basics of javascript programming language.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.