Unix
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix questions > Unix




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Unix  
escobo


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-20-04 02:34 AM

Listing The file data.txt has the following structure:
Item1	Item2	...	ItemN
------------------------------------------------
Value11	Value21	...	ValueN1
Value12	Value22	...	ValueN2
:		:			:
Value1M	Value2M	...	ValueNM

Create a script that displays the information from the file data.txt
sorted by some criteria. Your script should have the following input
parameters:
listing -h -ilist -olist -ffile
-h displays help
-ilist, list defines criteria for sorting,
-olist, list defines which values will be displayed on the output,
-ffile, name of the input file.

Example
listing -i3,4 -o2,1 -fstudents.txt
file students.txt has the following contents
Surname 	Name	Class	Group
---------------------------------------
Novak		Petr	3	24
Dvorak		Jiri	3	24
Kovarikova	Lenka	3	23
Michalek	Karel	4	12
Cesilko		Mirek	3	23

The script listing displays
Class 3
Group 23
Lenka Kovarikova
Mirek Cesilko
Group 24
Petr Novak
Jiri Dvorak
Class 4
Group 12
Karel Michalek





[ Post a follow-up to this message ]



    Re: Unix  
Chris F.A. Johnson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-20-04 02:34 AM

On Tue, 20 Apr 2004 at 00:46 GMT, escobo wrote:
> Listing The file data.txt has the following structure:
> Item1	Item2	...	ItemN
> ------------------------------------------------
> Value11	Value21	...	ValueN1
> Value12	Value22	...	ValueN2
>:		:			:
> Value1M	Value2M	...	ValueNM
>
> Create a script that displays the information from the file data.txt
> sorted by some criteria. Your script should have the following input
> parameters:
> listing -h -ilist -olist -ffile
> -h displays help
> -ilist, list defines criteria for sorting,
> -olist, list defines which values will be displayed on the output,
> -ffile, name of the input file.

[rest of homework assignment snipped]

You're in luck!

All your questions have already been answered in the
comp.unix.shell newsgroup. If you search the archives at
<http://groups.google.com/groups?group=comp.unix.shell>, you'll
find everything you need.

If you need more help, post the problem sections of your script to
the comp.unix.shell newsgroup. Be sure to explain exactly what is
going wrong (cut and paste error messages and incorrect output).


--
Chris F.A. Johnson                  http://cfaj.freeshell.org/shell
 ========================================
===========================
My code (if any) in this post is copyright 2004, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:29 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register