Sponsored Content
Top Forums Shell Programming and Scripting Extracting data from two date entries Post 302477228 by iga3725 on Friday 3rd of December 2010 05:14:33 PM
Old 12-03-2010
Extracting data from two date entries

Hi again:

I have this file:

Code:
"2010-11-1 11:50:00",40894,13.38,17.24,12.92,13.23,"2010-11-14 
11:43:02",12.56,"2010-11-14 11:46:02",22.68,20.95,"2010-11-14 
11:44:03",2.144,2.078,190.4,14.27,6.293,"2010-11-14 
11:47:58",172.8,526.5,0.07,280,349.4,837.1532,-241.8,"NAN","NAN","NAN","NAN","NAN","NAN"
.
.
"2010-11-14 11:50:00",40894,13.38,17.24,12.92,13.23,"2010-11-14 
11:43:02",12.56,"2010-11-14 11:46:02",22.68,20.95,"2010-11-14 
11:44:03",2.144,2.078,190.4,14.27,6.293,"2010-11-14 
11:47:58",172.8,526.5,0.07,280,349.4,837.1532,-241.8,"NAN","NAN","NAN","NAN","NAN","NAN"
data
"2010-11-15 11:50:00",40894,13.38,17.24,12.92,13.23,"2010-11-14 
11:43:02",12.56,"2010-11-14 11:46:02",22.68,20.95,"2010-11-14 
11:44:03",2.144,2.078,190.4,14.27,6.293,"2010-11-14 
11:47:58",172.8,526.5,0.07,280,349.4,837.1532,-241.8,"NAN","NAN","NAN","NAN","NAN","NAN"
data
"2010-11-16 11:50:00",40894,13.38,17.24,12.92,13.23,"2010-11-14 
11:43:02",12.56,"2010-11-14 11:46:02",22.68,20.95,"2010-11-14 
11:44:03",2.144,2.078,190.4,14.27,6.293,"2010-11-14 
11:47:58",172.8,526.5,0.07,280,349.4,837.1532,-241.8,"NAN","NAN","NAN","NAN","NAN","NAN"
data
.
.
"2010-11-29 11:50:00",40894,13.38,17.24,12.92,13.23,"2010-11-14 
11:43:02",12.56,"2010-11-14 11:46:02",22.68,20.95,"2010-11-14 
11:44:03",2.144,2.078,190.4,14.27,6.293,"2010-11-14 
11:47:58",172.8,526.5,0.07,280,349.4,837.1532,-241.8,"NAN","NAN","NAN","NAN","NAN","NAN"

I'm making a script which I passes an inittial and final date (only the date), and extract the date inside them to on another file?
Maybe something like this:

#script 2010-12-14 2010-12-16

Really appreciate your help
Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

extracting files using date in ksh

Hi All., 1 ssssss C2052EX 15 Mar 30 19:01 1 aaaaa C2052EX 15 Apr 3 10:12 1 ccccc C2052EX 15 Apr 4 09:28 i have files arriving like above. i am using the following to extract files arriving today ( say apr4) todaydat=`date | cut -c5-10` find... (1 Reply)
Discussion started by: pavan_test
1 Replies

2. Shell Programming and Scripting

Perl: Extracting date from file name and comparing with current date

I need to extract the date part from the file name (20080221 in this ex) and compare it with the current date and delete it, if it is a past date. $file = exp_ABCD4_T-2584780_upto_20080221.dmp.Z really appreciate any help. thanks mkneni (4 Replies)
Discussion started by: MKNENI
4 Replies

3. UNIX for Dummies Questions & Answers

extracting and using date from filenames in a loop

HIya, Having a dumb day whilst writing an archive process in Shell want to extract from the filename the date and archive into tar files based on this, I don't want to use mtime as it may not be the actual file date. The files are -rw-rw---- 1 user admin 100 Aug 29 11:10... (2 Replies)
Discussion started by: badg3r
2 Replies

4. UNIX for Dummies Questions & Answers

extracting date from a filename

Hi, I am a beginner in Unix so please bear with me... I have a directory which has files in format: RECF-YYYY-MM-DD-input. For example, RECF-2008-02-25-input. I need to extract the YYYYY-MM-DD substring from this filename and convert that into date and compare it with a date. How do I do that?... (7 Replies)
Discussion started by: laiko
7 Replies

5. Shell Programming and Scripting

Extracting Date from string

Hi Gurus I want to extract a date and version code which shall come in filename consisting of underscores. The filename can contain any / one underscores but the version number will come after date and will be separted by underscore String formats ============= ABC_20090815_2.csv... (13 Replies)
Discussion started by: r_t_1601
13 Replies

6. Homework & Coursework Questions

extracting date from log file

You are given a 1 year logfile with each line starting with a date in the form “YYYY-MM-DD”. How would you extract logs from the 4th day of each month and put them into a new file (1 Reply)
Discussion started by: DOkuwa
1 Replies

7. Shell Programming and Scripting

Extracting data from a log file with date formats

Hello, I have a log file for the year, which contains lines starting with the data in the format of YYYY-MM-DD. I need to get all the lines that contain the DD being 04, how would I do this? I tried using grep "*-*04" but it didn't work. Any quick one liners I should know about? Thank you. (2 Replies)
Discussion started by: cpickering
2 Replies

8. Shell Programming and Scripting

Extracting log entries from a date onwards

One of the log file looks like entries as below. Wed Apr 6 14:51:18 2011 FAIL LOGIN: Client "9.191.21.54" Wed Apr 6 14:52:53 2011 CONNECT: Client "9.191.21.54" Wed Apr 6 14:52:54 2011 OK LOGIN: Client "9.191.21.54" Wed Apr 6 14:55:10 2011 CONNECT: Client "9.191.21.54" Wed Apr 6... (2 Replies)
Discussion started by: rijeshpp
2 Replies

9. Shell Programming and Scripting

Extracting specific lines of data from a file and related lines of data based on a grep value range?

Hi, I have one file, say file 1, that has data like below where 19900107 is the date, 19900107 12 144 129 0.7380047 19900108 12 168 129 0.3149017 19900109 12 192 129 3.2766666E-02 ... (3 Replies)
Discussion started by: Wynner
3 Replies

10. Shell Programming and Scripting

extracting data

I have a txt file of the following format >ab_ qwerty >rt_ hfjkil >Ty2 hglashglkasghkf; >P2 aklhfklflkkgfgkfl >ui_ vnllkdskkkffkfkkf >we32 vksksjksj;lslsf'sk's's .... ..... I want to split this big file based on the header (>) (5 Replies)
Discussion started by: Lucky Ali
5 Replies
INFINITY(3)						     Linux Programmer's Manual						       INFINITY(3)

NAME
INFINITY, NAN, HUGE_VAL, HUGE_VALF, HUGE_VALL - floating-point constants SYNOPSIS
#define _ISOC99_SOURCE #include <math.h> INFINITY NAN HUGE_VAL HUGE_VALF HUGE_VALL DESCRIPTION
The macro INFINITY expands to a float constant representing positive infinity. The macro NAN expands to a float constant representing a quiet NaN (when supported). A quiet NaN is a NaN ("not-a-number") that does not raise exceptions when it is used in arithmetic. The opposite is a signaling NaN. See IEC 60559:1989. The macros HUGE_VAL, HUGE_VALF, HUGE_VALL expand to constants of types double, float and long double, respectively, that represent a large positive value, possibly plus infinity. CONFORMING TO
C99. AVAILABILITY
On a glibc system, the macro HUGE_VAL is always available. Availability of the NAN macro can be tested using #ifdef NAN, and similarly for INFINITY, HUGE_VALF, HUGE_VALL. They will be defined by <math.h> if _ISOC99_SOURCE or _GNU_SOURCE is defined, or __STDC_VERSION__ is defined and has a value not less than 199901L. SEE ALSO
fpclassify(3), feature_test_macros(7), math_error(7) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2007-07-26 INFINITY(3)
All times are GMT -4. The time now is 09:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy