Sponsored Content
Full Discussion: Sorting by date
Top Forums Shell Programming and Scripting Sorting by date Post 302822487 by RudiC on Monday 17th of June 2013 04:45:35 PM
Old 06-17-2013
Not sure I understand the problem:
Code:
sort file
001-def 2011-03-04
001-def 2012-04-05
012-abc 2011-06-07
012-abc 2011-07-14
012-abc 2012-04-25
043-jke 2009-01-13
043-jke 2009-01-31
043-jke 2011-04-01
043-jke 2012-06-01

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sorting on date

I have a file where dates in the form mm/dd/yyyy is the first field. How do I sort the file by the date field? Thanks, Duckman (6 Replies)
Discussion started by: Duckman
6 Replies

2. UNIX for Dummies Questions & Answers

date sorting

Hi at all, I have to sort a log file on timestamp field. That's field is the third! a log file sample..... 1|EVTVOD-1-20060709_000614|2006/07/09-0:11:23|0.3.8 1|EVTVOD-1-20060709_000614|2006/07/09-0:11:16|0.3.8 1|EVTVOD-1-20060709_000614|2006/07/09-0:11:20|0.3.8... (3 Replies)
Discussion started by: nmilella
3 Replies

3. Shell Programming and Scripting

Sorting a date coulumn

Hi All, I have a file say abc.txt with the below data. 1234 876S 01Mar2007 foo 1244 65DF 19Jan2007 boo 9924 234K 01Jan2006 koo 8866 8FGH 12Feb1999 roo 7777 ASDF 13May2007 soo I need this file to be in sorted order depending on the date field. e.g 8866 8FGH 12Feb1999 roo... (2 Replies)
Discussion started by: rinku11
2 Replies

4. Shell Programming and Scripting

Date Sorting

Hi, I have a list of files that take on the format ABCDE_yymmdd and wish to sort them in ascending date order. I can't use the unix time stamp for the file as this could possibly be different from the date given in the file name. Does anyone know of any way this can be done using unix shell... (14 Replies)
Discussion started by: LiquidChild
14 Replies

5. UNIX for Dummies Questions & Answers

Sorting by date and time

Hi guys... I've been trying to do this for ages. Maybe you can help. I have log files like the examples below and I have grepped out certain lines from the files so that I can get an idea of who is logging on and how. So now I have the information in a new file but it is now in a different order... (7 Replies)
Discussion started by: padmundo
7 Replies

6. Shell Programming and Scripting

Date and Time sorting

Hi Guys! i have a problem of sorting column chronologically because the data i have in column is in the following format 06/Dec/2006:18:09:54 and need to be sorted in the following way (upto seconds) 06/Dec/2005:18:09:50 06/Dec/2005:18:09:51 31/Mar/2006:19:30:41 24/Oct/2006:19:16:19... (4 Replies)
Discussion started by: me_newbie
4 Replies

7. Shell Programming and Scripting

date(ddmmyyyy) sorting

input : 20110730 20110730 20110731 20110731 20110801 20110801 20110801 20110813 20110815 01062011 01062011 OUTPUT : i need to sort this input in such a way so that the latest date comes first. (11 Replies)
Discussion started by: urfrnddpk
11 Replies

8. Shell Programming and Scripting

Sorting the data with date

Hi, PFB the data: C_Random_130417 Java_Random_130518 Perl_Random_120519 Perl_Random_120528 so the values are ending with year,i.e.,130417 i want to sort the values with date. i want the output like this: Perl_Random_120519 Perl_Random_120528 C_Random_130417 Java_Random_130518 can... (5 Replies)
Discussion started by: arindam guha
5 Replies

9. Shell Programming and Scripting

Sorting on date basis

I have file data.txt having below data cat data.txt 01-MAY-13 2.38.11.00.100089 IN 4512 0000741881 01-MAY-13 2.38.11.00.100089 IN 4512 0000741881 01-JUN-13 2.38.11.00.100089 FC 1514 0000764631 01-NOV-13 2.38.11.00.100089 FC 1514 0000856571 01-NOV-13 2.38.11.00.100089 IN 300.32... (1 Reply)
Discussion started by: ranabhavish
1 Replies

10. UNIX for Dummies Questions & Answers

Sorting on fields for last date

Hi all, I have a file with a list of rpm's that have different dates. I am trying to just grab the latest rpm and install date, and discard the rest. The file has 1000's of entries all with different names and dates. I have tried sort -k on the file and I am not grabbing the info, ... (4 Replies)
Discussion started by: gartie
4 Replies
DtSearchValidDateString(library call)									     DtSearchValidDateString(library call)

NAME
DtSearchValidDateString -- Validate and convert a user date string SYNOPSIS
#include <Dt/Search.h> DtSrObjdate DtSearchValidDateString( char *date_string); DESCRIPTION
DtSearchValidDateString validates a DtSearch date string, as might have been entered by a user in a free form text field, and converts it into a valid DtSrObjdate. Since an invalid date string format returns a distinctive DtSrObjdate, this function may also be used as a boolean test for string valid- ity. ARGUMENTS
date_string Specifies the date string to be validated and converted. The format for a valid date string is "[yyyy [mm [dd]]", one, two, or three ASCII numeric tokens separated by one or more nonnu- meric chars (whitespace, slashes, etc). The integer yyyy represents a Gregorian calendar year number in the range 1990 to 5995 inclusive. If yyyy is less than 1900, 1900 is added to it. The integer mm is a Gregorian calendar month number in the range 1 to 12 inclusive. The integer dd is a Gregorian calendar day number in the range 1 to 31 inclusive. If only two tokens are in the string, they are presumed to be yyyy and mm, and dd is presumed to be to 1. If only one token is in the string, it is presumed to be yyyy, and both mm and dd are presumed to be 1. RETURN VALUE
DtSearchValidDateString returns zero (a valid DtSrObjdate) if date_string is NULL or empty. It returns a correctly formatted DtSrObjdate on successful parse and conversion. It returns -1 and a message on the MessageList if date_string is invalid. SEE ALSO
DtSrAPI(3), DtSearchQuery(3), dtsrfzkfiles(4), DtSearch(5) DtSearchValidDateString(library call)
All times are GMT -4. The time now is 03:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy