Sponsored Content
Top Forums Shell Programming and Scripting Get the lines from logfile within start and end date Post 302841011 by rdcwayx on Tuesday 6th of August 2013 10:49:05 PM
Old 08-06-2013
Quote:
Originally Posted by Yoda
Code:
st="2013-08-01"
en="2013-08-03"

awk -v ST="$st" -v EN="$en" '
        {
                V = $1
                gsub ( "-", X, V )
                gsub ( "-", X, ST )
                gsub ( "-", X, EN )
                if ( V >= ST && V <= EN )
                        print
        }
' file.log

recommend to move below lines to BEGIN{} part in awk, which will avoid to gsub on each line again.

Code:
                gsub ( "-", X, ST )
                gsub ( "-", X, EN )

These 2 Users Gave Thanks to rdcwayx For This Post:
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to capture all dates between start date and End date.

Hi All, I enter Start date and end date as parameters. I need to capture dates between start date and end date. Please let me know if you have any idea the same. Thanks in advance. Nagaraja Akkivalli. (5 Replies)
Discussion started by: Nagaraja Akkiva
5 Replies

2. Shell Programming and Scripting

Need to capture dates between start date and end date Using perl.

Hi All, Want to get all dates and Julian week number for that date between the start date and end date. How can I achive this using perl? (To achive above functionality, I was connecting to the database from DB server. Need to execute the same script in application server, since databse... (6 Replies)
Discussion started by: Nagaraja Akkiva
6 Replies

3. Shell Programming and Scripting

Extract week start,end date from given date in PERL

Hi All, what i want to do in perl is i should give the date at run time .Suppose date given is 23/12/2011(mm/dd/yyyy) the perl script shold find week start date, week end date, previous week start date,end date,next week start date, end date. In this case week start date will be-:12/19/2011... (2 Replies)
Discussion started by: parthmittal2007
2 Replies

4. Shell Programming and Scripting

Remove lines between the start string and end string including start and end string Python

Hi, I am trying to remove lines once a string is found till another string is found including the start string and end string. I want to basically grab all the lines starting with color (closing bracket). PS: The line after the closing bracket for color could be anything (currently 'more').... (1 Reply)
Discussion started by: Dabheeruz
1 Replies

5. UNIX for Dummies Questions & Answers

Print start date to end date, given $1 & $2 in ksh

Dear all, I have an user passing 2 parameter 31/03/2015 and 02/04/2015 to a ksh script. How to print the start date to end date. Expected output is : 31/03/2015 01/04/2015 02/04/2015 Note : 1. Im using aix and ksh 2. I have tried to convert the given input into a date, didnt... (0 Replies)
Discussion started by: mr.rajaravi
0 Replies

6. UNIX for Beginners Questions & Answers

How to print lines from a files with specific start and end patterns and pick only the last lines?

Hi, I need to print lines which are matching with start pattern "SELECT" and END PATTERN ";" and only select the last "select" statement including the ";" . I have attached sample input file and the desired input should be as: INPUT FORMAT: SELECT ABCD, DEFGH, DFGHJ, JKLMN, AXCVB,... (5 Replies)
Discussion started by: nani2019
5 Replies

7. UNIX for Beginners Questions & Answers

Splitting week start date and end date based on custom period start dates

Below are my custom period start and end dates based on a calender, these dates are placed in a file, for each period i need to split into three weeks for each period row, example is given below. Could you please help out to achieve solution through shell script.. File content: ... (2 Replies)
Discussion started by: nani2019
2 Replies
SFDDIFF(1)						      General Commands Manual							SFDDIFF(1)

NAME
sfddiff - compare two font files SYNOPSIS
sfddiff [--help] [--ignorehints] [--ignorenames] [--ignoregpos] [--ignoregsub] [--ignorebitmaps] [--exact] [--warn] [--merge outfile] [--usage] [--version] fontfile1 fontfile2 DESCRIPTION
The program sfddiff compares two font files, which may be in any format fontforge(1) can read. It will notice the following differences: 1) Characters are present in one font but not in the other. 2) Characters are present in both fonts but have different sets of outlines or references. The outlines may be compared so that only exact matches are accepted, or so that a fuzzier match is used. Similarly references may need to match exactly, or may be matched after an unlink. This fuzzy comparison is useful when comparing truetype and postscript fonts, or when comparing a font with references to one with- out. 3) The postscript hints or truetype instructions are different. 4) The font names (the truetype `name' table) differ. 5) The kerning (and other `gpos' information) differs. 6) The ligatures (and other `gsub' information) differ. 7) Any bitmap strikes present in one font but not in the other. 8) Any bitmap characters present in one strike of one font but in the equivalent strike of the other. 9) Any bitmap characters which differ. OPTIONS
--help Provide a description with a list of the available options. --ignorehints Suppress the reporting of hint/instruction differences. --ignoregpos Suppress the reporting of kerning (and other `gpos') differences. --ignoregsub Suppress the reporting of ligature (and other `gsub') differences. --ignorenames Suppress the reporting of name string differences. --ignorebitmaps Suppress the reporting of bitmap differences. --exact Require outlines to match exactly. --warn Warn if the outlines/references are slightly different. --merge outfile Store a merged version of the two fonts into the specified output file. The merged data will be based on sfdfile1, as well as any characters present in sfdfile2 but not in sfdfile1 will be added, and the outlines of sfdfile2 will be placed in the background. Finally, for any characters with different outlines or references the background of the character will contain the outlines from sfdfile2 (references will be unlinked into outlines and those outlines also will be added). --usage Display the usage description. --version Display the current version. SEE ALSO
fontforge(1) The HTML version of the fontforge manual at: http://fontforge.sourceforge.net/ AUTHOR
Copyright (C) 2000-2006 by George Williams (gww@silcom.com). Manual page heavily rewritten and modified to use standard -man(5) macros by R.P.C. Rodgers (rodgers@nlm.nih.gov), 23 October 2002. 8 April 2006 SFDDIFF(1)
All times are GMT -4. The time now is 08:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy