Sponsored Content
Top Forums Shell Programming and Scripting Extracting date-time from file. Post 302134934 by skumar11 on Tuesday 4th of September 2007 03:48:35 PM
Old 09-04-2007
Extracting date-time from file.

I have the following file and need to extract date and time part for each record. Pl. could anyone provide an shell script which could be used to do it. Here is the file:
Code:
/rgrdev/pdsud2/unx/agc/src/agcmst:
     /rgrsrc/pdspms/unx/agc/src/s.agcmst.for
     agcmst.for 420.20 8/4/07 18:30:53
     /rgrsrc/pdsbas/unx/agc/src/s.agtrnd.for
     agtrnd.for 2.8 8/4/07 18:30:18
     /rgrsrc/pdspms/unx/agc/src/s.hyagc.for
     hyagc.for 420.2 8/4/07 18:30:36
     /rgrsrc/pdspms/unx/agc/src/s.permon.for
     permon.for 420.24 8/4/07 18:30:43
     /rgrsrc/pdspms/unx/agc/src/s.rescal.for
     rescal.for 420.4 8/4/07 18:30:44
     /rgrsrc/pdspms/unx/agc/src/s.jouflt.for
     jouflt.for 420.6 8/4/07 18:30:38
     ercalm.for pdsras 08/04/07 18:30:32
     /rgrsrc/pdspms/unx/agc/src/s.rtproc.for
     rtproc.for 420.3 8/4/07 18:30:48
     timef.c    1.6 12/12/05 16:09:42 /rgrsrc/pdsbas/unx/forshl/src/s.timef.c
     rlscrf.c   1.4 12/12/05 16:09:36 /rgrsrc/pdsbas/unx/forshl/src/s.rlscrf.c
     GETUCD.c   1.2 5/7/07 16:16:09 /rgrsrc/pdsbas/unx/epashl/src/s.GETUCD.c
     /rgrsrc/pdspms/unx/epashl/src/s.llmvar.for
     llmvar.for 420.2 5/7/07 16:17:36   @(#) /rgrsrc/pdspms/unx/epashl/src/s.rprcal.for
     rprcal.for 420.1 5/7/07 16:18:01    @(#) /rgrsrc/pdspms/unx/epashl/src/s.unmvar.for
     unmvar.for 420.3 5/7/07 16:18:22
     /rgrsrc/pdspms/unx/epashl/src/s.nsrcal.for
     nsrcal.for 420.3 5/7/07 16:17:43   @(#) /rgrsrc/pdspms/unx/epashl/src/s.rrscal.for
     rrscal.for 420.5 5/7/07 16:18:01    @(#) /rgrsrc/pdspms/unx/epashl/src/s.dbecal.for
     dbecal.for 420.5 5/7/07 16:16:54  @(#) /rgrsrc/pdspms/unx/epashl/src/s.ubecal.for
     ubecal.for 420.4 5/7/07 16:18:22  @(#) /rgrsrc/pdspms/unx/epashl/src/s.drscal.for
     drscal.for 420.4 5/7/07 16:17:01   @(#) /rgrsrc/pdspms/unx/epashl/src/s.urscal.for
     urscal.for 420.4 5/7/07 16:18:23   @(#) /rgrsrc/pdspms/unx/epashl/src/s.loscal.for
     loscal.for 420.1 5/7/07 16:17:36
     appalm.c   1.5 5/7/07 16:16:14 /rgrsrc/pdsbas/unx/epashl/src/s.appalm.c
     topchk.c   1.2 3/11/07 20:45:53 /rgrsrc/pdsbas/unx/scs/src/s.topchk.c
     /rgrsrc/pdspms/unx/ed/src/s.findst.for
     findst.for 420.1 6/27/07 09:45:34
    V1.0
    $RCSfile: crt0.s,v $ $Revision: 1.1.26.2 $ (DEC) $Date: 1997/04/03 22:25:40 $


Pl. help me out to find the solution. Early responce highly appreciated.

Last edited by vgersh99; 09-04-2007 at 06:09 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Processing a log file based on date/time input and the date/time on the log file

Hi, I'm trying to accomplish the following and would like some suggestions or possible bash script examples that may work I have a directory that has a list of log files that's periodically dumped from a script that is crontab that are rotated 4 generations. There will be a time stamp that is... (4 Replies)
Discussion started by: primp
4 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. Shell Programming and Scripting

Convert Epoch time format to normal date time format in the same file

I have a file named "suspected" with series of line like these : {'protocol': 17, 'service': 'BitTorrent KRPC', 'server': '219.78.120.166', 'client_port': 52044, 'client': '10.64.68.44', 'server_port': 8291, 'time': 1226506312L, 'serverhostname': ''} {'protocol': 17, 'service': 'BitTorrent... (3 Replies)
Discussion started by: rk4k
3 Replies

4. Shell Programming and Scripting

Extracting lines in file based on time

Hi, anyone has any ideas on how do we extract lines from a file with format similiar to this: (based on current time) Jun 18 00:16:50 .......... ............. ............ Jun 18 00:17:59 .......... ............. ............ Jun 18 01:17:20 .......... ............. ............ Jun 18... (5 Replies)
Discussion started by: faelric
5 Replies

5. Shell Programming and Scripting

Extracting date & time from file name

Hi, I am having a file name as exp_bkp_tables_18_Oct_2010_10_50_28.dmp which is used for import the records. Now, I want to print the output using the selected file name as below : Table records will get restored as on date 18-Oct-2010 and time 10:50:28 How it can be done ? With... (5 Replies)
Discussion started by: milink
5 Replies

6. UNIX for Dummies Questions & Answers

Extracting a Time Span from Syslog Messages File

Hi all, I need your help to explain how I can extract a time span from the syslog messages file on a Solaris 10 system. Here is an example extract of the syslog messages: Dec 4 11:51:38 hajap141-0107.nls.jlrint.com 267938: Dec 4 11:51:36: %DOT11-6-DISASSOC: Interface Dot11Radio0,... (4 Replies)
Discussion started by: wthomas
4 Replies

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

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

9. Shell Programming and Scripting

extracting data from file using time stamp

Hi Guys ! is it possible to extract lines from a file which satisfy a time contraint for example program should consider two boundaries one current time and second the user define time and then extract all those line which fall into that specified time lets say 10 (user define time) and 12... (5 Replies)
Discussion started by: ourned
5 Replies

10. Shell Programming and Scripting

Extracting log files based on date and time.

Hi All, i have some log files generated in a folder daily with the format abc.def.20130306.100001 ghi.jkl.20130306.100203 abc.def.20130305.100001 ghi.jkl.20130305.100203 the format is the date followed by time . all i want is to get the files that are generated for todays... (3 Replies)
Discussion started by: mahesh300182
3 Replies
VM(1)								      mgetty								     VM(1)

NAME
vm - VoiceModem is the program for handling the voice modem functionality from shell scripts ACTIONS
beep options [<frequency [<length in 0.001sec>]]> diagnostics options device name (e.g. ttyS2 dial options phone number help play options [<file names]+> record options file name shell options [<shell script [shell options]]> wait options [<time in seconds]> devicetest OPTIONS
-c n use compression type n -d n set i/o device -t, -m, -i, -e, -s, -H equals to -d <2,3,4,5,6,7> -l s set device string (e.g. -l ttyS2:ttyC0) -v verbose output -w use off / on hook signal from local handset to start and stop recording -x n set debug level -L n set maximum recording length in sec -P print first DTMF tone on stdout and exit -R read and print DTMF string on stdout and exit -S s set default shell for shell scripts (e.g. -S /bin/sh) -T n set silence timeout in 0.1sec -V n set silence threshold to <n> (0-100%%) SEE ALSO
vgetty(1) POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 30: You forgot a '=back' before '=head1' Around line 32: '=item' outside of any '=over' Around line 71: You forgot a '=back' before '=head1' perl v5.10.1 2010-04-04 VM(1)
All times are GMT -4. The time now is 01:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy