Grep file containing dates


 
Thread Tools Search this Thread
The Lounge What is on Your Mind? Grep file containing dates
# 8  
Old 12-20-2018
You really should have mentioned HP-UX from the start. So can we assume ksh88? The reason for this should be obvious - not all UNIXes have exactly the same commands or even exactly the same syntax for a given command. Solaris even has multiple versions of commands like awk. HP-UX usually supports ksh88, and comes with an ancient C compiler by default - as examples. So our answers can be wrong right out of the box. Wasting your time and ours.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replacing the Dates in a file

Hello Gurus, I'm beginner in Shell scripting. I got a requirement to write a script. I have a file with below (similar) content If you can observe above content, there are many date values existed (with different dates) in a format: ddMonyyyy I have to write replace all these... (7 Replies)
Discussion started by: raghu.iv85
7 Replies

2. 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

3. Shell Programming and Scripting

Grep search for value between dates

Hi I am new to scripting and I have a requirement to grep a value from large numbers of xml files and see if this value exist then I want to check the date and see if it falls between two dates (eg: today and feb 17), then print the name of file. the values in xml file is as follow... (7 Replies)
Discussion started by: mmsiddig
7 Replies

4. 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

5. Shell Programming and Scripting

How to processing the log file within certain dates based on the file name

Hi I am working on the script parsing specific message "TEST" from multiple file. The log file name looks like: N3.2009-11-26-03-05-02.console.log.tar.gz N4.2009-11-29-00-25-03.console.log.tar.gz N6.2009-12-01-10-05-02.console.log.tar.gz I am using the following command: zgrep -a --text... (1 Reply)
Discussion started by: shyork2001
1 Replies

6. 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

7. Shell Programming and Scripting

Help to switch dates from a file

Hi. I need some assistance with a file who at the end i must import to EXCEL. The problem is that i have a file with this inside: Output: JOBID START TIME END TIME ELAPSED CPU ------------------------------------------------------------ AVERAGE: ... (2 Replies)
Discussion started by: osramos
2 Replies

8. Shell Programming and Scripting

grep a log file to filter previous dates

Hi, I have problem of filtering a log file from my perl script. #cat /data/pinpe.csv_20070731 | nawk -v FS=, '{print $1','$18','$22','$26}' | grep -w 100 | grep -w 1 | nawk '{print $4}' Below is the output: 2009-06-16 2009-01-29 2009-06-02 2008-03-05 2007-08-05 2007-09-24... (5 Replies)
Discussion started by: pinpe
5 Replies

9. Shell Programming and Scripting

grep a log file between 2 dates

Hi Currently I can grep a log file with the following command: $results = `grep -A 2 '^$date.$time.*' $log`; and the following arguments: $date = 2007/04/25 $time = 16:07 Log example: 2007/04/25 16:07:12.145701 2007/05/25 14:07:12.145701 2007/05/25 17:07:12.145701 2007/06/25... (37 Replies)
Discussion started by: Epiphone
37 Replies

10. UNIX for Dummies Questions & Answers

Formatting dates in a file

Hi! Sitting with a headache this morning and can't get the brain around it! I have a file with 32000 lines that needs to be inserted onto a database. My problem is with the following: First part between bars is a date and second some identifiers |19511108|0001417| |19481024|0001439|... (6 Replies)
Discussion started by: maverick
6 Replies
Login or Register to Ask a Question
ZGREP(1)                                                      General Commands Manual                                                     ZGREP(1)

NAME
zgrep - search possibly compressed files for a regular expression SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename... DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code: (-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. If the GREP environment variable is set, zgrep uses it as the grep program to be invoked. EXIT CODE
2 - An option that is not supported was specified. AUTHOR
Charles Levert (charles@comm.polymtl.ca) SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1) ZGREP(1)