Sponsored Content
Full Discussion: Finding Data in the file
Top Forums Shell Programming and Scripting Finding Data in the file Post 302849583 by Prashantckc on Monday 2nd of September 2013 11:25:19 AM
Old 09-02-2013
The strftime is available, However am Trying to do the below, but not getting the needed result
Code:
awk -F, 'BEGIN{today=strftime("%b %e %Y")} 
{ #print substr($NF,1,11)
  #print today
 (substr($NF,1,11)== today)
}
' infile

The reason being that the NF contains the Time as well (Which is always marked as 00:00:00)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding duplicate data in a file

A pogram named LOGGEDON returns an output of: Ref_num IP Address Logged on User 12000 10.10.12.12 12-02-2002 11:00 john 12004 10.10.12.13 12-03-2002 14:00 mary 12012 10.10.12.14 12-03-2002 11:30 bob 12024 ... (1 Reply)
Discussion started by: dinplant
1 Replies

2. Shell Programming and Scripting

finding data in a file

Hello, I am new to shell programming, and Unix development overall. I have a following text file with the following contents: .. Sunny Monday: x Tuesday: x Wednesday: x Thursday: x Friday: x Cloudy Monday: x Tuesday: x Wednesday: x ... (11 Replies)
Discussion started by: Selma
11 Replies

3. Shell Programming and Scripting

finding null records in data file

I am having a "|" delimited flat file and I have to pick up all the records with the 2nd field having null value. Please suggest. (3 Replies)
Discussion started by: dsravan
3 Replies

4. Shell Programming and Scripting

Finding Overlap between two sets of data

Hi everyone, I posted this earlier, but the idea changed since then and I figured it would make more sense if I repost with a clearer idea in hopes someone can help me out. I have two lists of data in file1 and file 2 file1 (tab separated - column1 column2 column 3) 1 91625106 ... (1 Reply)
Discussion started by: labrazil
1 Replies

5. Shell Programming and Scripting

Finding Minimum value per Row range of data

Here is an example of a file I am working with: C 4704 CB 1318 ASP 115 BGRF 1 weak 0.0% 4.33 C 4720 OD 1322 ASP 115 BGRF 1 weak 0.0% 3.71 O 4723 OD 1322 ASP 115 BGRF 1 weak 0.0% 3.48 O 4723 CG 1321 ASP 115 BGRF 1 weak 0.0% 4.34... (3 Replies)
Discussion started by: userix
3 Replies

6. Shell Programming and Scripting

Parsing chunks of text and finding data

Hi, I need a script that parses and greps data out of a textfile. I have a text file that has this structure: File1 host1.localdomain text random text Found errors this text is random (41123) --- random random at.5165 ---- random random at.5165 ---- random random at.5165 ----... (2 Replies)
Discussion started by: erick_tuk
2 Replies

7. HP-UX

finding these, whether previous data stored ?

Hi All, On HP Unix, 11.23 can following be checked , Processes which were consuming more 1)CPU 2)Memory 3)page faults For particular Time Frame say Yesterday 7 Am to 7.30 Am and , Yesterday Evening 19.00 Pm to 19.30 Pm Please specify how. whether we need to enable, some... (6 Replies)
Discussion started by: sidharthmellam
6 Replies

8. Shell Programming and Scripting

Finding standard deviation for all columns in a data file

Hi All, I want someone to modify the below script from this forum so that it can be used for all columns in the file( instead of only printing column 3 mean and standard deviation values). I don't know how to loop around all the columns. ... (3 Replies)
Discussion started by: ks_reddy
3 Replies

9. Shell Programming and Scripting

Finding data in large no. of files

I need to find some data in a large no. of files. The data is in the following format : VALUE A VALUE B VALUE C VALUE D 10 4 65 1 12 4.5 65.5 2 10.75 5.1 ... (2 Replies)
Discussion started by: cooker97
2 Replies

10. UNIX for Dummies Questions & Answers

Finding data value that contains x% of points

Hi, I need help on finding the value of my data that encompasses certain percentage of my total data points (n). Attached is an example of my data, n=30. What I want to do is for instance is find the minimum threshold that still encompasses 60% (n=18), 70% (n=21) and 80% (n=24). manually to... (4 Replies)
Discussion started by: ida1215
4 Replies
cronosplit(1m)															    cronosplit(1m)

NAME
cronosplit - split log files into cronolog-compatible files SYNOPSIS
cronosplit --template=TEMPLATE [--print-invalid] [--help] [--version] file ... DESCRIPTION
cronosplit is a simple program that reads lines from a set of input log files, which must be in Common Log Format or NCSA Combined/XLF/ELF Format and write each lines to an output files, the name of which is constructed using the template specified and timestamp from the the line. The template uses the same format specifiers as the Unix date(1) command (which are the same as the standard C strftime library function). Options cronosplit accepts the following options and arguments: --template=TEMPLATE specifies the template for the output log files (using the format specifiers described below). --print-invalid print invalid log file entries to the standard error stream. --utime update modification time of output file according to last parsed log entry. --verbose print additional status messages to the standard error stream. --debug print debug messages to the standard error stream. --help print a help message and then exit. --version print version information and exit. Template format Each character in the template represents a character in the expanded filename, except for date and time format specifiers, which are replaced by their expansion. Format specifiers consist of a `%' followed by one of the following characters: % a literal % character n a new-line character t a horizontal tab character Time fields: H hour (00..23) I hour (01..12) p the locale's AM or PM indicator M minute (00..59) S second (00..61, which allows for leap seconds) X the locale's time representation (e.g.: "15:12:47") Z time zone (e.g. GMT), or nothing if the time zone cannot be determined Date fields: a the locale's abbreviated weekday name (e.g.: Sun..Sat) A the locale's full weekday name (e.g.: Sunday .. Saturday) b the locale's abbreviated month name (e.g.: Jan .. Dec) B the locale's full month name, (e.g.: January .. December) c the locale's date and time (e.g.: "Sun Dec 15 14:12:47 GMT 1996") d day of month (01 .. 31) j day of year (001 .. 366) m month (01 .. 12) U week of the year with Sunday as first day of week (00..53, where week 1 is the week containing the first Sunday of the year) W week of the year with Monday as first day of week (00..53, where week 1 is the week containing the first Monday of the year) w day of week (0 .. 6, where 0 corresponds to Sunday) x locale's date representation (e.g. today in Britain: "12/04/96") y year without the century (00 .. 99) Y year with the century (1970 .. 2038) Other specifiers may be available depending on the C library's implementation of the strftime function. SEE ALSO
apache(1m) cronolog(1m) date(1) strftime(3) environ(5) More information and the latest version of cronolog and cronosplit can be obtained from http://www.ford-mason.co.uk/resources/cronolog/ If you have any suggestions, bug reports, fixes, or enhancements, please mail them to the author. More about Apache Documentation for the Apache http server is available from http://www.apache.org AUTHOR
Andrew Ford <A.Ford@ford-mason.co.uk> cronosplit is based on a script called splitlog by Roy Fielding, which is part of the wwwstat package. March 1998 cronosplit(1m)
All times are GMT -4. The time now is 01:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy