Sponsored Content
Top Forums UNIX for Advanced & Expert Users Sort in fields date and columns. Post 302785445 by systemoper on Monday 25th of March 2013 04:04:49 PM
Old 03-25-2013
Sort in fields date and columns.

Hi colleagues,
I have this output, i need sort for 7th and 8th columns, the column 7th is date mm/dd/yyyy format and column 8th is time hh:mm:ss.number

PRUEBA 1263 0007 1 0 7131292 03/25/2013 16:43:04.159976 PROCESS
PRUEBA1 666 0146 1 0 11600064 03/25/2013 20:35:36.360453 PROCESS
PRUEBA 1232 0002 1 0 6602856 03/21/2013 10:34:04.043798 PROCESS
PRUEBA 1230 0002 1 0 9531456 03/21/2013 10:34:04.012895 PROCESS
PRUEBA 1228 0002 1 0 1769492 03/21/2013 10:34:04.012897 PROCESS
PRUEBA 1191 1270 1 0 5374148 03/25/2013 20:38:30.262300 PROCESS
PRUEBA 1186 0022 1 0 1515770 03/21/2013 10:34:04.214680 PROCESS
PRUEBA 1184 0022 1 0 9023516 03/21/2013 10:34:02.250458 PROCESS
PRUEBA 719 0033 1 0 1007752 03/25/2013 20:35:33.049410 PROCESS
PRUEBA 1142 0007 1 0 11038858 03/24/2013 03:07:52.129286 PROCESS
PRUEBA 1135 0022 1 0 8429658 03/21/2013 10:34:01.686071 PROCESS
PRUEBA 1128 0022 1 0 7278834 03/21/2013 10:34:03.878008 PROCESS
PRUEBA 901 0027 1 0 15548564 03/24/2013 03:08:40.213620 PROCESS
PRUEBA 899 0022 1 0 5456014 03/21/2013 10:33:00.883023 PROCESS
PRUEBA 1218 0023 1 0 15687680 03/24/2013 03:09:57.445248 PROCESS
PRUEBA 1208 1263 1 0 2564242 03/25/2013 20:34:48.322591 PROCESS
PRUEBA 1182 0002 1 0 15323318 03/21/2013 10:34:02.108932 PROCESS
PRUEBA 1179 0002 1 0 6193256 03/21/2013 10:34:02.086872 PROCESS
PRUEBA 1178 0022 1 0 1687770 03/21/2013 10:34:04.139296 PROCESS
PRUEBA 1175 0022 1 0 11354354 03/21/2013 10:34:04.096087 PROCESS
PRUEBA 1172 0022 1 0 15192186 03/21/2013 10:34:02.077381 PROCESS
PRUEBA 1169 0022 1 0 962692 03/21/2013 10:34:02.064175 PROCESS
PRUEBA 1167 1391 1 0 14794986 03/25/2013 20:33:41.071634 PROCESS

The output will be show in this form.
PRUEBA 1191 1270 1 0 5374148 03/25/2013 20:38:30.262300 PROCESS
PRUEBA1 666 0146 1 0 11600064 03/25/2013 20:35:36.360453 PROCESS
PRUEBA 719 0033 1 0 1007752 03/25/2013 20:35:33.049410 PROCESS
PRUEBA 1208 1263 1 0 2564242 03/25/2013 20:34:48.322591 PROCESS
PRUEBA 1167 1391 1 0 14794986 03/25/2013 20:33:41.071634 PROCESS
PRUEBA 1263 0007 1 0 7131292 03/25/2013 16:43:04.159976 PROCESS
PRUEBA 1218 0023 1 0 15687680 03/24/2013 03:09:57.445248 PROCESS
PRUEBA 901 0027 1 0 15548564 03/24/2013 03:08:40.213620 PROCESS
PRUEBA 1142 0007 1 0 11038858 03/24/2013 03:07:52.129286 PROCESS
PRUEBA 1186 0022 1 0 1515770 03/21/2013 10:34:04.214680 PROCESS
PRUEBA 1128 0022 1 0 7278834 03/21/2013 10:34:03.878008 PROCESS
PRUEBA 1184 0022 1 0 9023516 03/21/2013 10:34:02.250458 PROCESS
PRUEBA 1135 0022 1 0 8429658 03/21/2013 10:34:01.686071 PROCESS

thank you for advanced.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sort fields

I have a large csv file that looks like this: 14 ,M0081,+000000001,200302,+00000100500, 14 ,M0081,+000000004,200301,+00000100500, 14 ,M0081,+000000005,200305,+00000100500, 14 ,M0081,+000000000,200205,+00000100500, 14 ,M0081,+000000008,200204,+00000100500, ... (2 Replies)
Discussion started by: edog
2 Replies

2. Shell Programming and Scripting

sort on fields

Hi I have following fixed width file and I have to sort on 2 fields ABC 111222333002555 77788 ABC 111222333004555 77788 ABC 111222333001555 77788 ABC 111222333003555 77788 ABC 111222333005555 77788 one is from field1 to field 3 "ABC" and another is on 14 to 16 "002" (based on first... (1 Reply)
Discussion started by: mgirinath
1 Replies

3. Shell Programming and Scripting

Sort two columns in a field, one of them being a date

Hi, I have a set of columns in a csv file, my first row being an integer and 2nd being a date. I want to first sort it using the first column and then by the second. for e.g. i have , 1234,09/05/2009,hi 5678,01/01/2008,hi 1234,11/03/2006,hello 5678,28/07/2010,hello i tried this... (5 Replies)
Discussion started by: sweta_doshi
5 Replies

4. UNIX for Dummies Questions & Answers

sort on three fields

Hi I would like to sort a csv file. It has 50 fields and approx 1400000 lines. I want to sort by three columns as follows. Say sort on coulmn 5, if entries are equal sort on column 3 if this is also equal sort on column 6. It seems that this is possible for 5 then 3 i.e. sort -t "," -k 5,5 -k... (1 Reply)
Discussion started by: turquoise_man
1 Replies

5. UNIX for Dummies Questions & Answers

Sort on first two fields -only-

Hey, I have a file i want to sort. It contains these kind of lines: FirstName LastName buyID buyType Eg: John Doe 22 Car Jane Simpson 4 Headset John Doe 11 Telephone Now if I use the sort command on it cat purchases.txt | sort -k1,1 -k2,2 it would also sort the third and 4th field:... (4 Replies)
Discussion started by: ce3c
4 Replies

6. Shell Programming and Scripting

doing a sort on first two fields

hi, i'm having a file stg_ff.txt which contains 10 fields,which contains millions of records i need to cat the first 10 rows in the file after doing a sorting on the first two fields i n the file. can any body help me on this. regards Angel (4 Replies)
Discussion started by: angel12345
4 Replies

7. Shell Programming and Scripting

Deleting all the fields(columns) from a .csv file if all rows in that columns are blanks

Hi Friends, I have come across some files where some of the columns don not have data. Key, Data1,Data2,Data3,Data4,Data5 A,5,6,,10,, A,3,4,,3,, B,1,,4,5,, B,2,,3,4,, If we see the above data on Data5 column do not have any row got filled. So remove only that column(Here Data5) and... (4 Replies)
Discussion started by: ks_reddy
4 Replies

8. Shell Programming and Scripting

Sort help: How to sort collected 'file list' by date stamp :

Hi Experts, I have a filelist collected from another server , now want to sort the output using date/time stamp filed. - Filed 6, 7,8 are showing the date/time/stamp. Here is the input: #---------------------------------------------------------------------- -rw------- 1 root ... (3 Replies)
Discussion started by: rveri
3 Replies

9. Shell Programming and Scripting

Sort on first fields only

Please advice in this. Input file 100,vvvt 201,unb 100,sos 301,abc 99,gang desired output 99,gang 100,vvvt 100,sos 201,unb 301,abc Means if first fields are same ( here 100) the do not sort. (4 Replies)
Discussion started by: theshashi
4 Replies

10. Shell Programming and Scripting

awk sort based on difference of fields and print all fields

Hi I have a file as below <field1> <field2> <field3> ... <field_num1> <field_num2> Trying to sort based on difference of <field_num1> and <field_num2> in desceding order and print all fields. I tried this and it doesn't sort on the difference field .. Appreciate your help. cat... (9 Replies)
Discussion started by: newstart
9 Replies
stopped(7)                                               Miscellaneous Information Manual                                               stopped(7)

NAME
stopped - event signalling that a job has stopped SYNOPSIS
stopped JOB=JOB INSTANCE=INSTANCE RESULT=RESULT [PROCESS=PROCESS] [EXIT_STATUS=STATUS] [EXIT_SIGNAL=SIGNAL] [ENV]... DESCRIPTION
The stopped event is generated by the Upstart init(8) daemon when an instance of a job has stopped. The JOB environment variable contains the job name, and the INSTANCE environment variable contains the instance name which will be empty for single-instance jobs. If the job was stopped normally, the RESULT environment variable will be ok, otherwise if the job was stopped because it has failed it will be failed. When the job has failed, the process that failed will be given in the PROCESS environment variable. This may be pre-start, post-start, main, pre-stop or post-stop; it may also be the special value respawn to indicate that the job was stopped because it hit the respawn limit. Finally in the case of a failed job, one of either EXIT_STATUS or EXIT_SIGNAL may be given to indicate the cause of the stop. Either EXIT_STATUS will contain the exit status code of the process, or EXIT_SIGNAL will contain the name of the signal that the process received. The normal exit job configuration stanza can be used to prevent particular exit status values or signals resulting in a failed job, see init(5) for more information. If neither EXIT_STATUS or EXIT_SIGNAL is given for a failed process, it is because the process failed to spawn (for example, file not found). See the system logs for the error. init(8) emits this event as an informational signal, services and tasks started or stopped by this event will do so in parallel with other activity. It is typically combined with the starting(7) event by services when inserting themselves as a dependency. Job configuration files may use the export stanza to export environment variables from their own environment into the stopped event. See init(5) for more details. EXAMPLE
A service that wishes to be running whenever another service would be running, started before and stopped after it, might use: start on starting apache stop on stopped apache A task that must be run after another task or service has been stopped might use: start on stopped postgresql SEE ALSO
starting(7) started(7) stopping(7) init(5) Upstart 2009-07-09 stopped(7)
All times are GMT -4. The time now is 08:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy