Sponsored Content
Full Discussion: Searching between dates
Top Forums Shell Programming and Scripting Searching between dates Post 81543 by Unbeliever on Monday 22nd of August 2005 07:34:20 AM
Old 08-22-2005
Lots of ways to do it, easy if you have the Date::Manip perl module, but without you could put the following code in a file (make it executable). and run it with the input text file as the argument.

Assumes all lines are of the format in your original post and there are no leading spaces on the lines.

Code:
#!/usr/bin/perl
%months = (
  jul => 7,
  aug => 8,
  sep => 9
);

while (<>)
{
  @a = split('-');

  if ( $months{$a[1]} == 8 ||
       ($months{$a[1]} == 7 && $a[0] >= 9) ||
       ($months{$a[1]} == 9 && $a[0] <= 30)
     )
  {
    print;
  }
}

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help searching log file with dates

Im tyring to create a script that will show me any lines in a file with todays date and yesterdays, the date format in the file is as follows ----- amqxfdcx.c : 728 -------------------------------------------------------- 07/12/05 09:53:20 AMQ6109: An internal WebSphere MQ error has... (3 Replies)
Discussion started by: csaunders
3 Replies

2. Shell Programming and Scripting

Need script to generate all the dates in DDMMYY format between 2 dates

Hello friends, I am looking for a script or method that can display all the dates between any 2 given dates. Input: Date 1 290109 Date 2 010209 Output: 300109 310109 Please help me. Thanks. :):confused: (2 Replies)
Discussion started by: frozensmilz
2 Replies

3. Programming

SQL: find if a set od dates falls in another set of dates

Don't know if it is important: Debian Linux / MySQL 5.1 I have a table: media_id int(8) group_id int(8) type_id int(8) expiration date start date cust_id int(8) num_runs int(8) preferred_time int(8) edit_date timestamp ON UPDATE CURRENT_TIMESTAMP id... (0 Replies)
Discussion started by: vertical98
0 Replies

4. Emergency UNIX and Linux Support

Replacing dates]] with (dates)]]

Hi guys, For my wiki site I need to fix 1400 pages that use the wrong date format, most pages (not all) use eg. 1988]] I need to change that to (1988)]] The date range goes back to 1400 so I guess I need to do the following ssh into my server, dump mysql database vi .sql dump search... (20 Replies)
Discussion started by: lawstudent
20 Replies

5. Shell Programming and Scripting

searching a file with a specified text without using conventional file searching commands

without using conventional file searching commands like find etc, is it possible to locate a file if i just know that the file that i'm searching for contains a particular text like "Hello world" or something? (5 Replies)
Discussion started by: arindamlive
5 Replies

6. UNIX for Dummies Questions & Answers

How to write the dates between 2 dates into a file

Hi All, I am trying to print the dates that falls between 2 date variables into a file. Here is the example. $BUS_DATE =20120616 $SUB_DATE=20120613 Output to file abc.txt should be : 20120613,20120614,120120615,20120616 Can you pls help me accomplish this in LINUX. Thanks... (5 Replies)
Discussion started by: dsfreddie
5 Replies

7. Shell Programming and Scripting

Generating dates between two dates

HI, i have row like this HHH100037440313438961000201001012012073110220002 N in this i have 2 dates in pos 25-32 and 33-40 , so based upon the se two dates , i need to generated records between these two values so in the above record 20100101 and 20120731 need to genearte rows like this... (4 Replies)
Discussion started by: sathishsr
4 Replies

8. UNIX for Advanced & Expert Users

How to get the Missing dates between two dates in the table?

Hi Am Using Unix Ksh ... I have a Table called date select * from date ; Date 01/02/2013 06/02/2013 I need the output as Missing Date 01/02/2013 02/02/2013 03/02/2013 04/02/2013 05/02/2013 06/02/2013 (2 Replies)
Discussion started by: Venkatesh1
2 Replies

9. Shell Programming and Scripting

Help searching for dates - Oracle ALERT log

Hi, I am searching for some specific string in an Oracle DB alert log and then possibly print the latest date string that I can find that the error happen. I can't work out how to search for date strings more so searching in some specific direction, i.e backward or forward. At the moment,... (1 Reply)
Discussion started by: newbie_01
1 Replies

10. Shell Programming and Scripting

Display dates between two dates

Hi All, I have 2 dates in mm/dd format. sdate=10/01 (October 01) edate=10/10 (October 10) I need the dates in between these 2 dates like below. 10/01 10/02 10/03 10/04 10/05 10/06 10/07 10/08 (1 Reply)
Discussion started by: jayadanabalan
1 Replies
DateTime::Locale::nn(3) 				User Contributed Perl Documentation				   DateTime::Locale::nn(3)

NAME
DateTime::Locale::nn SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'nn' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Norwegian Nynorsk. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) maandag tysdag onsdag torsdag fredag laurdag sondag Abbreviated (format) maa. ty. on. to. fr. la. so. Narrow (format) M T O T F L S Wide (stand-alone) maandag tysdag onsdag torsdag fredag laurdag sondag Abbreviated (stand-alone) maa. ty. on. to. fr. la. so. Narrow (stand-alone) M T O T F L S Months Wide (format) januar februar mars april mai juni juli august september oktober november desember Abbreviated (format) jan feb mar apr mai jun jul aug sep okt nov des Narrow (format) J F M A M J J A S O N D Wide (stand-alone) januar februar mars april mai juni juli august september oktober november desember Abbreviated (stand-alone) jan feb mar apr mai jun jul aug sep okt nov des Narrow (stand-alone) J F M A M J J A S O N D Quarters Wide (format) 1. kvartal 2. kvartal 3. kvartal 4. kvartal Abbreviated (format) K1 K2 K3 K4 Narrow (format) 1 2 3 4 Wide (stand-alone) 1. kvartal 2. kvartal 3. kvartal 4. kvartal Abbreviated (stand-alone) K1 K2 K3 K4 Narrow (stand-alone) 1 2 3 4 Eras Wide f.Kr. e.Kr. Abbreviated f.Kr. e.Kr. Narrow f.Kr. e.Kr. Date Formats Full 2008-02-05T18:30:30 = tysdag 5. februar 2008 1995-12-22T09:05:02 = fredag 22. desember 1995 -0010-09-15T04:44:23 = laurdag 15. september -10 Long 2008-02-05T18:30:30 = 5. februar 2008 1995-12-22T09:05:02 = 22. desember 1995 -0010-09-15T04:44:23 = 15. september -10 Medium 2008-02-05T18:30:30 = 5. feb. 2008 1995-12-22T09:05:02 = 22. des. 1995 -0010-09-15T04:44:23 = 15. sep. -10 Short 2008-02-05T18:30:30 = 05.02.08 1995-12-22T09:05:02 = 22.12.95 -0010-09-15T04:44:23 = 15.09.-10 Default 2008-02-05T18:30:30 = 5. feb. 2008 1995-12-22T09:05:02 = 22. des. 1995 -0010-09-15T04:44:23 = 15. sep. -10 Time Formats Full 2008-02-05T18:30:30 = kl. 18.30.30 UTC 1995-12-22T09:05:02 = kl. 09.05.02 UTC -0010-09-15T04:44:23 = kl. 04.44.23 UTC Long 2008-02-05T18:30:30 = 18.30.30 UTC 1995-12-22T09:05:02 = 09.05.02 UTC -0010-09-15T04:44:23 = 04.44.23 UTC Medium 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 Short 2008-02-05T18:30:30 = 18.30 1995-12-22T09:05:02 = 09.05 -0010-09-15T04:44:23 = 04.44 Default 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 Datetime Formats Full 2008-02-05T18:30:30 = tysdag 5. februar 2008 kl. 18.30.30 UTC 1995-12-22T09:05:02 = fredag 22. desember 1995 kl. 09.05.02 UTC -0010-09-15T04:44:23 = laurdag 15. september -10 kl. 04.44.23 UTC Long 2008-02-05T18:30:30 = 5. februar 2008 18.30.30 UTC 1995-12-22T09:05:02 = 22. desember 1995 09.05.02 UTC -0010-09-15T04:44:23 = 15. september -10 04.44.23 UTC Medium 2008-02-05T18:30:30 = 5. feb. 2008 18.30.30 1995-12-22T09:05:02 = 22. des. 1995 09.05.02 -0010-09-15T04:44:23 = 15. sep. -10 04.44.23 Short 2008-02-05T18:30:30 = 05.02.08 18.30 1995-12-22T09:05:02 = 22.12.95 09.05 -0010-09-15T04:44:23 = 15.09.-10 04.44 Default 2008-02-05T18:30:30 = 5. feb. 2008 18.30.30 1995-12-22T09:05:02 = 22. des. 1995 09.05.02 -0010-09-15T04:44:23 = 15. sep. -10 04.44.23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 ty. 1995-12-22T09:05:02 = 22 fr. -0010-09-15T04:44:23 = 15 la. Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h.mm a) 2008-02-05T18:30:30 = 6.30 ettermiddag 1995-12-22T09:05:02 = 9.05 formiddag -0010-09-15T04:44:23 = 4.44 formiddag Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h.mm.ss a) 2008-02-05T18:30:30 = 6.30.30 ettermiddag 1995-12-22T09:05:02 = 9.05.02 formiddag -0010-09-15T04:44:23 = 4.44.23 formiddag M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, M-d) 2008-02-05T18:30:30 = ty., 2-5 1995-12-22T09:05:02 = fr., 12-22 -0010-09-15T04:44:23 = la., 9-15 MMdd (dd.MM) 2008-02-05T18:30:30 = 05.02 1995-12-22T09:05:02 = 22.12 -0010-09-15T04:44:23 = 15.09 MMM (LLL) 2008-02-05T18:30:30 = feb 1995-12-22T09:05:02 = des -0010-09-15T04:44:23 = sep MMMd (MMM d) 2008-02-05T18:30:30 = feb 5 1995-12-22T09:05:02 = des 22 -0010-09-15T04:44:23 = sep 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = ty. feb 5 1995-12-22T09:05:02 = fr. des 22 -0010-09-15T04:44:23 = la. sep 15 MMMMd (d. MMMM) 2008-02-05T18:30:30 = 5. februar 1995-12-22T09:05:02 = 22. desember -0010-09-15T04:44:23 = 15. september MMMMEd (E MMMM d) 2008-02-05T18:30:30 = ty. februar 5 1995-12-22T09:05:02 = fr. desember 22 -0010-09-15T04:44:23 = la. september 15 ms (mm.ss) 2008-02-05T18:30:30 = 30.30 1995-12-22T09:05:02 = 05.02 -0010-09-15T04:44:23 = 44.23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, y-M-d) 2008-02-05T18:30:30 = ty., 2008-2-5 1995-12-22T09:05:02 = fr., 1995-12-22 -0010-09-15T04:44:23 = la., -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 feb 1995-12-22T09:05:02 = 1995 des -0010-09-15T04:44:23 = -10 sep yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = ty., 2008 feb 5 1995-12-22T09:05:02 = fr., 1995 des 22 -0010-09-15T04:44:23 = la., -10 sep 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 februar 1995-12-22T09:05:02 = 1995 desember -0010-09-15T04:44:23 = -10 september yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 K1 1995-12-22T09:05:02 = 1995 K4 -0010-09-15T04:44:23 = -10 K3 yyMM (MM.yy) 2008-02-05T18:30:30 = 02.08 1995-12-22T09:05:02 = 12.95 -0010-09-15T04:44:23 = 09.-10 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = februar 2008 1995-12-22T09:05:02 = desember 1995 -0010-09-15T04:44:23 = september -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week maandag SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.18.2 2017-10-06 DateTime::Locale::nn(3)
All times are GMT -4. The time now is 04:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy