06-06-2008
Script to Extract time from log files and write to a excel
Can someone help me with writing a unix script for following requirement
1) I have a log file in which we have start time and end time (format: hh:mm:ss)
Example: starting script on Thu Jun 5 20:50:52
---------
Thu Jun 5 21:55:33 - Script Completed
2) I want to extract start time and end time of the script (ex: 20:50:52 and 21:55:33) from the log file (on unix server) and write into a excel file (in a shared drive).
3) I need to collect these start and end times every day and write into the excel (this excel will be stored in a shared drive) and also I have around 50 logs which i need to go thru to get the start and end times.
4) Once the start and end times are extracted into excel file, I need to get the time taken for completion of the script (by substracting end time from start time) and populate the result value into another cell of the excel.
For example, My ouput should look like this.
Start Time End Time Time to Complete
19:41:42 20:25:18 00:43:36
Your help with this script is greatly appriciated.
Thanks,
S
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Execute some commands in script and store result in excel sheet
Kindly help me........... (1 Reply)
Discussion started by: Computer_baby
1 Replies
2. UNIX for Advanced & Expert Users
Can someone help me with writing a unix script for following requirement
1) I have a log file in which we have start time and end time (format: hh:mm:ss)
Example: starting script on Thu Jun 5 20:50:52
Thu Jun 5 21:55:33 - Script Completed
2) I want to extract start time and end time of... (0 Replies)
Discussion started by: santosham
0 Replies
3. Shell Programming and Scripting
Can someone help me with writing a unix script for following requirement
1) I have a log file in which we have start time and end time (format: hh:mm:ss)
Example: starting script on Thu Jun 5 20:50:52
Thu Jun 5 21:55:33 - Script Completed
2) I want to extract start time and end time of... (0 Replies)
Discussion started by: santosham
0 Replies
4. Shell Programming and Scripting
Hi,
I have a script that works on a unix box but am trying to get it working on a linux box that uses shell. I am not a programmer so this is proving harder than I imagined. I made some changes and ended up with the script below but when I run it I get the following messages. Any help would be... (4 Replies)
Discussion started by: yabai
4 Replies
5. UNIX for Dummies Questions & Answers
Hi
I need to put together a script that will search certain tables in a db and send that data to a csv file.
Basically I am importing data to a db and I want to write a script to check that all information was imported correctly.
Thank you (1 Reply)
Discussion started by: ladyAnne
1 Replies
6. Shell Programming and Scripting
Hi!
I have one file with data that looks like this:
1 data data data data
2 data data data data
3 data data data data
.
.
.
1 data data data data
2 data data data data
3 data data data data
.
.
.
I would like to have awk to write each block to a separate file, like this:
1... (3 Replies)
Discussion started by: LinWin
3 Replies
7. Shell Programming and Scripting
Hi Experts,
I want to write a script, based upon the following requirement
1) I am having 5 application
$ cd logs
$ ls -l
drwxr-xr-x 2 natraj nat 5.0K Sep 20 10:25 one
drwxr-xr-x 2 natraj nat 5.0K Sep 20 10:39 two
drwxr-xr-x 2 natraj nat 1.5K Sep 20 10:58... (4 Replies)
Discussion started by: natraj005
4 Replies
8. Shell Programming and Scripting
Hi All,
I have the requirement in unix shell script.
I want to write the "ls -ltr" command out put to excel file as below.
Input :text file data :
drwxr-xr-x 5 root root 4096 Oct 2 12:26
drwxr-xr-x 2 apx aim 4096 Nov 29 18:40
drwxr-xr-x 5 root root 4096 Oct 2 12:26
drwxr-xr-x... (10 Replies)
Discussion started by: Balasankar
10 Replies
9. Shell Programming and Scripting
All,
I have an excel sheet Excel1.xls that has some entries.
I have one more excel sheet Excel2.xls that has entries only in those cells which are blank in Excel1.xls
These may be in different workbooks. They are totally independent made by 2 different users.
I have placed them in a... (1 Reply)
Discussion started by: Anamika08
1 Replies
10. Shell Programming and Scripting
I have requirement to write two CSV files to one single excel with multiple sheets.
Data present in the two files should sit in excel as different sheets.
How can we achieve this using shell script?
1.csv 2. csv
1,2,3,4 5,6,7,8
XXXXX YYYYY
Res.excel
1.csv data... (1 Reply)
Discussion started by: duplicate
1 Replies
LEARN ABOUT HPUX
xgetmotionevents
XGetMotionEvents() XGetMotionEvents()
Name
XGetMotionEvents - get events from pointer motion history buffer.
Synopsis
XTimeCoord *XGetMotionEvents(display, w, start, stop, nevents_return)
Display *display;
Window w;
Time start, stop;
int *nevents_return;
Arguments
display Specifies a connection to an X server; returned from XOpenDisplay().
w Specifies the ID of the window whose associated pointer motion events will be returned.
start Specify the time interval for which the events are returned from the motion history buffer. Pass a time stamp (in milliseconds)
stop or CurrentTime.
nevents_return
Returns the number of events returned from the motion history buffer.
Returns
The list of pointer positions.
Description
XGetMotionEvents() returns all events in the motion history buffer that fall between the specified start and stop times (inclusive) and
that have coordinates that lie within (including borders) the specified window at its present placement. The x and y coordinates of the
XTimeCoord return structure are reported relative to the origin of w.
XGetMotionEvent returns NULL if the server does not support a motion history buffer (which is common), or if the start time is after the
stop time, or if the start time is in the future. If the stop time is in the future, it is equivalent to specifying the constant Current-
Time, since the server does not wait to report future events. A motion history buffer is supported if XDisplayMotionBufferSize() (display)
> 0. The pointer position at each pointer hardware interrupt is then stored for later retrieval.
Use XFree() to free the returned XTimeCoord structures when they are no longer needed.
For more information, see Volume One, Chapter 9, The Keyboard and Pointer.
Structures
typedef struct _XTimeCoord {
Time time;
short x, y;
} XTimeCoord;
Errors
BadWindow
See Also
XQLength(), XAllowEvents(), XCheckIfEvent(), XCheckMaskEvent(), XCheckTypedEvent(), XCheckTypedWindowEvent(), XCheckWindowEvent(),
XEventsQueued(), XGetInputFocus(), XIfEvent(), XMaskEvent(), XNextEvent(), XPeekEvent(), XPeekIfEvent(), XPending(), XPutBackEvent(), XSe-
lectInput(), XSendEvent(), XSetInputFocus(), XSynchronize(), XWindowEvent().
Xlib - Input Handling XGetMotionEvents()