The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 11-29-2005
netmaster netmaster is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 6
Complex Pipeline/Redirection/Regular Expression problem

This is a very hard unix command which I could not perform..... ......here it is:


The file ~unx122/public/data.txt contains over 18,000 lines of text. Here are the first ten lines of the file:

pagination 20657 2740 28416 31090 18145

shiner 1695 2507 9964 14512 13122

cool 29210 23832 22861 25037 18722

entertain 16186 23873 5049 3781 15735

sandwiches 9407 61 10817 7342 18224

sustenance 27174 8344 331 18238 25000

humanitarian 29733 13594 5573 24760 20213

Gus 10371 20643 22256 28933 7187

promoting 24678 31046 5759 7005 29626

ethereal 4963 15542 12202 23911 31595


Each line contains a word and five numbers, each separated by spaces. There are no spaces or punctuation marks in any of the words; each word consists of only upper- and lower-case letters. All of the numbers are whole numbers (no decimals and no negative numbers). There are no leading zeros (extra zeros added to the start of the numbers).

*****************************************************

From the file ~unx122/public/data.txt, select all of the lines that
have a word in column one that starts and ends with vowels
and have values between 1000 and 9999 in the third column.

Sort these lines in reverse order according to column 3, then
select lines 15 through 37. Finally, put these lines in
normal order according to column 1 and write them to the file
~/uli101_a2_output.txt (overwrite any data already in that file).

Create a command pipeline to perform this task. In the file ~/uli101_assignment2, place an appropriate bash shebang line, then your command pipeline.


Definitions

Here are the definitions of some of the terms used in the problem description:

Vowel - one of the letters: a, e, i, o, or u.

Consonant - any letter that is not a vowel.

Character - any letter,number, digit, space, or punctuation character.

Upper-Case - CAPITAL LETTERS

Lower-Case - non-capital letters

Odd digit - one of these digits: 1, 3, 5, 7, or 9.

Even digit - one of these digits: 0, 2, 4, 6, or 8.

Odd number - A number which is not evenly divisible by 2 (a number
ending in an odd digit).

Even number - A number which is evenly divisible by 2 (a number
ending in an even digit).

Normal order - Ascending order (lowest to highest value).
Use a numeric sort for numbers, or an ASCII sort for text.

Reverse order - Descending order (highest to lowest value).
Use a numeric sort for numbers, or an ASCII sort for text.