Sorting only certain data in file.
From: TB (chessgame_at_gmail.com)
Date: 02/15/05
- Previous message: Tom Shippee: "ksh parsing question"
- Next in thread: Greg Beeker: "Re: Sorting only certain data in file."
- Reply: Greg Beeker: "Re: Sorting only certain data in file."
- Reply: John L: "Re: Sorting only certain data in file."
- Reply: Dave Gibson: "Re: Sorting only certain data in file."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 14 Feb 2005 20:14:32 -0800
I have a text file that has a lot of data in it that I need to sort. I
have an application that has a command similar to `who` that shows all
the users that are logged into the app. Every hour I have a script
that gets the hostname, date, and the users. Unfortunately the command
doesn't sort the users how I would like. What i would like is to sort
by the users so that I can see multiple logins. Or better yet, show
only the duplicate logins (in full so that I can see how many times
they are logged in).
Below is an example of what I have. Basically I need everything
between the ### and the ------------------------ sorted, while
maintaining the other parts so I know what server, day, and hour the
data is for. (in the real file there are hundreds of users).
I've been scratching my head on and off all day trying to come up with
some way of doing this. Anyone have any ideas.
Thanks.
------------------------
edgar
Mon Feb 14 20:00:36 CST 2005
###
buckt :0 Nov 10 16:21
buckt pts/1 Feb 14 21:39 (192.168.0.117)
------------------------
------------------------
edgar
Mon Feb 14 21:00:22 CST 2005
###
buckt :0 Nov 10 16:21
buckt pts/1 Feb 14 21:39 (192.168.0.117)
------------------------
- Previous message: Tom Shippee: "ksh parsing question"
- Next in thread: Greg Beeker: "Re: Sorting only certain data in file."
- Reply: Greg Beeker: "Re: Sorting only certain data in file."
- Reply: John L: "Re: Sorting only certain data in file."
- Reply: Dave Gibson: "Re: Sorting only certain data in file."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|