![]() |
|
|
|||||||
| Home | Forums | Register | Rules & FAQ | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
Other UNIX.COM Threads You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need a regular expression | tony3101 | Shell Programming and Scripting | 4 | 4 Weeks Ago 12:13 AM |
| Regular Expression Problem | chris1234 | UNIX for Dummies Questions & Answers | 12 | 04-02-2008 04:44 AM |
| Regular Expression problem | djkane | Shell Programming and Scripting | 5 | 06-21-2006 07:07 AM |
| Regular Expression Problem | netmaster | UNIX for Dummies Questions & Answers | 1 | 12-07-2005 05:34 PM |
| Regular Expression + Aritmetical Expression | Z0mby | Shell Programming and Scripting | 2 | 05-21-2002 07:59 AM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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. |
| Forum Sponsor | ||
|
|
|
||||
|
had you completed ~/uli101_assignment1, it would have made it easier complete this assignment as well.
Pls read the rules of this forum and refrain from posting the homework assignments in the future. Thread closed. |
||||
| Google UNIX.COM |