Sorting only certain data in file.

From: TB (chessgame_at_gmail.com)
Date: 02/15/05

  • Next message: TB: "Re: ksh parsing question"
    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)

    ------------------------


  • Next message: TB: "Re: ksh parsing question"

    Relevant Pages

    • coreutils-7.3 released [stable]
      ... been a few other interesting fixes and improvements. ... run a command like this: ... sort -m no longer segfaults when its output file is also an input file. ... destination file system with a fundamental block size of 4KiB or greater. ...
      (gnu.announce)
    • Re: FC1 Install _appeared_ to work, BUT...
      ... what sort of messages do make it to screen? ... I used to run RHL7.3, dual booting, on a Sony Vaio laptop. ... command prompt only safe-mode in windows but without the GUI). ...
      (Fedora)
    • Re: getline caveats misuse howto
      ... populates the ERRNO builtin variable if getline fails. ... down the two-way pipe to the UNIX "sort" command. ... gawk terminates the coprocess and exits. ...
      (comp.lang.awk)
    • Re: [OT] Compiler warning level
      ... > have command lines" when they enter the course. ... I started -- well, OK, unless you count the front panel switches and the ... lights on the panel could be called a GUI, they were sort of graphical ... I tend to write the makefile before typing in the start of the ...
      (comp.lang.c)
    • Re: BROWSE: order by column
      ... oHdr is now a reference to the header object ... descending sort. ... If you have a lot of columns that would be a lot of command ... Just add the code to change the sort order to a new ...
      (microsoft.public.fox.programmer.exchange)