Sponsored Content
Top Forums Shell Programming and Scripting getting timestamp of a file and if it was accessed today then finding a line in it Post 302601946 by rajniman on Saturday 25th of February 2012 05:14:58 AM
Old 02-25-2012
getting timestamp of a file and if it was accessed today then finding a line in it

i have my files and the variables value extracted from db is taken as

in1=slot0312
in2=best
in3=it is :veryliong/fine

as varibles..

i have a folder stuctures in my unix machine as :

/2011/hand_sl0312/best/HOD/file1.txt
/2011/hand_sl0312/happy/HOD/file1.txt
/2012/hand_sl0312/best/HOD/file1.txt
/2012/hand_sl0312/happy/HOD/file1.txt
/2012/hand_sl0612/normal/HOD/file1.txt
/2012/hand_sl0612/best/HOD/file1.txt

llly many more.

in2 variable values can be any of the folders names from folder /2012/hand_sl0312/ in machine extracted from db or /2012/hand_sl0612/ or /2012/hand_RI12/ ,etc

in1 values are all from folder /2012/ or /2013/ but here format remains hand_sl0312. so values for in1 is like sl0312,sl0612 , etc..if in1 value is sl0312 then it is to be searched in folder /2012/hand_sl0312/ and if in2 value is "best" as above eg then it is to be searched in /2012/hand_sl0312/best and in3 value is to find in that folder based on access of file in folder /2012/hand_sl0312/best/HOD/file1.txt .. i.e if file1.txt is acessed that day then find value in3 in that file . if present . then no need to output .if not present then it should be written in other file for output..

but this three values are compared by taking all at a time ..so for above example.


so in this example
in1=slot0312
in2=best
in3=it is :veryliong/fine

the file /2012/hand_sl0312/best/HOD/file1.txt will be searched for in3 variable value i.e "it is :veryliong/fine"..

if it would have been eg as
in1=slot0612
in2=normal
in3=alwaysdoing:verylioniseong/fine

then the file /2012/hand_sl0612/normal/HOD/file1.txt (found from all variables) should be checked if it was accessed same day then only for value in3=alwaysdoing:verylioniseong/fine will be searched


the folder /2012/ or /2011/ or /2013/ , etc should be choosen depending on value in1, i.e suppose value of in1=slot0612 then folder /2012/ should be choosen and if it conatains in1=slot0311 then folder /2011/ should be choosen . this folder is choosen from last two digits value from in1 as in1=slot0312 so last two digit is 12 so choose 2012 , iif it would be 11 then choose 2011 and then proceed..


this values in1, in2, in3 are extracted from database...so having a huge dataB..
unix code for this comparison is needed...plz help

Last edited by rajniman; 02-25-2012 at 03:08 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

finding latest file having timestamp on it.....

Hi guys, I have a directory in UNIX having files with the below format, i need to pickup the latest file having recent timestamp embedded on it, then need to rename it to a standard file name. Below is the file format: filename_yyyymmdd.csv, i need to pick the latest and move it with the... (1 Reply)
Discussion started by: kaushik25
1 Replies

2. Shell Programming and Scripting

Find files older then today & display with timestamp info

Small query- I want to do some operation on all the files older then today. Before I do that operation, i want to verify if the command works properly or not. Surprisingly, the command below returns me file, which are created today - find /mrk_archive/PG/ftp/incomming/gbs/2008 -type f... (2 Replies)
Discussion started by: kedar.mehta
2 Replies

3. UNIX for Dummies Questions & Answers

Need help finding a file where a pattern exists and the file has a timestamp

So, I know how to do some of this stuff on an individual level, but I'm drawing a blank as to how to put it all together. I have a pattern that I'm looking for in a log file. The log file I know came in yesterday, so I want to limit the search to that day's listing of files. How would I do... (5 Replies)
Discussion started by: kontrol
5 Replies

4. Shell Programming and Scripting

finding the line number of a particular line in a file

Hi Frnds, I need to find the line number of a particular line in a file and store that line number to a variable. if a file named myfile contains following look at the sun look at the moon look at the star look at the ocean i need to get the line number of the line 'look at the... (3 Replies)
Discussion started by: mvignesh
3 Replies

5. UNIX for Advanced & Expert Users

Finding user accounts not accessed for a specific number of days

Hi all, Recently I came across a challenge of finding the user accounts lying around on servers and not being used so much. Our client has hundreds of AIX, RedHat, and Solaris servers. For AIX, I have made a script which uses lsuser and a little bit of sed and awk to show the user accounts... (7 Replies)
Discussion started by: admin_xor
7 Replies

6. Shell Programming and Scripting

Appending unix timestamp to every line of a statistical file

I have a statistical file populating every minute as below: 2011-11-11-1108 1955 891 2011-11-11-1109 2270 1049 2011-11-11-1110 1930 904 2011-11-11-1111 2030 931 2011-11-11-1112 1944 900 2011-11-11-1113 1922 875 Instead of having the date and time in the given format (2011-11-11-1113) I... (10 Replies)
Discussion started by: thinktank
10 Replies

7. Shell Programming and Scripting

Help with finding last line of file: if statement depending on that line.

Good morning, My first time actually posting in this forum, though I have used this forum to help with numerous projects. I am trying to figure out why my if statement does not work. I have a file where a line is inputted every 15 seconds. I want this if statement to check what the last line... (3 Replies)
Discussion started by: Shanrunt
3 Replies

8. UNIX for Dummies Questions & Answers

Finding the modified timestamp of files from the piped output of du command

Version Info +++++++++++++++ RHEL 5.4 Since ls command lists file sizes in Bytes which can be long I use du command like below. I have run the du command for the below files as shown below. But I want pipe this output to ls command just to see the modified timestamp for these files. ... (7 Replies)
Discussion started by: kraljic
7 Replies

9. Shell Programming and Scripting

Finding the maximum timestamp in a folder

I've the files in a directory in the following format having date +%Y%m%d%H YR_MNTH_2013061205 YR_MNTH_2013060107 and i need the latest file i.e; YR_MNTH_2013061205 to be moved to another folder #!/bin/ksh # Ksh 88 Version for test_time in YR* do --- done How can i achieve that !... (2 Replies)
Discussion started by: smile689
2 Replies

10. Shell Programming and Scripting

Error when connecting to remote server to find files with timestamp today's day

I am connecting to remote server and try to check if files with timestamp as Today's day are on the directory. Below is my code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly; Today=`date +%Y%m%d`; if ;then echo "We... (1 Reply)
Discussion started by: digioleg54
1 Replies
QStyleOption(3qt)														 QStyleOption(3qt)

NAME
QStyleOption - Optional parameters for QStyle functions SYNOPSIS
#include <qstyle.h> Public Members enum StyleOptionDefault { Default } QStyleOption ( StyleOptionDefault = Default ) QStyleOption ( int in1, int in2 ) QStyleOption ( int in1, int in2, int in3, int in4 ) QStyleOption ( QMenuItem * m ) QStyleOption ( QMenuItem * m, int in1 ) QStyleOption ( QMenuItem * m, int in1, int in2 ) QStyleOption ( const QColor & c ) QStyleOption ( QTab * t ) QStyleOption ( QListViewItem * i ) QStyleOption ( QCheckListItem * i ) QStyleOption ( Qt::ArrowType a ) QStyleOption ( const QRect & r ) QStyleOption ( QWidget * w ) bool isDefault () const int lineWidth () const int midLineWidth () const int frameShape () const int frameShadow () const QMenuItem * menuItem () const int maxIconWidth () const int tabWidth () const const QColor & color () const QTab * tab () const QCheckListItem * checkListItem () const QListViewItem * listViewItem () const Qt::ArrowType arrowType () const QRect rect () const QWidget * widget () const DESCRIPTION
The QStyleOption class specifies optional parameters for QStyle functions. Some QStyle functions take an optional argument specifying extra information that is required for a paritical primitive or control. So that the QStyle class can be extended, QStyleOption is used to provide a variable-argument for these options. The QStyleOption class has constructors for each type of optional argument, and this set of constructors may be extended in future Qt releases. There are also corresponding access functions that return the optional arguments: these too may be extended. For each constructor, you should refer to the documentation of the QStyle functions to see the meaning of the arguments. When calling QStyle functions from your own widgets, you must only pass either the default QStyleOption or the argument that QStyle is documented to accept. For example, if the function expects QStyleOption(QMenuItem *, int), passing QStyleOption(QMenuItem *) leaves the optional integer argument uninitialized. When subclassing QStyle, you must similarly only expect the default or documented arguments. The other arguments will have uninitialized values. If you make your own QStyle subclasses and your own widgets, you can make a subclass of QStyleOption to pass additional arguments to your QStyle subclass. You will need to cast the "const QStyleOption&" argument to your subclass, so be sure your style has been called from your widget. See also Widget Appearance and Style. Member Type Documentation QStyleOption::StyleOptionDefault This enum value can be passed as the optional argument to any QStyle function. QStyleOption::Default MEMBER FUNCTION DOCUMENTATION
QStyleOption::QStyleOption ( StyleOptionDefault = Default ) The default option. This can always be passed as the optional argument to QStyle functions. QStyleOption::QStyleOption ( int in1, int in2 ) Pass two integers, in1 and in2. For example, linewidth and midlinewidth. QStyleOption::QStyleOption ( int in1, int in2, int in3, int in4 ) Pass four integers, in1, in2, in3 and in4. QStyleOption::QStyleOption ( QMenuItem * m ) Pass a menu item, m. QStyleOption::QStyleOption ( QMenuItem * m, int in1 ) Pass a menu item and an integer, m and in1. QStyleOption::QStyleOption ( QMenuItem * m, int in1, int in2 ) Pass a menu item and two integers, m, in1 and in2. QStyleOption::QStyleOption ( const QColor & c ) Pass a color, c. QStyleOption::QStyleOption ( QTab * t ) Pass a QTab, t. QStyleOption::QStyleOption ( QListViewItem * i ) Pass a QListViewItem, i. QStyleOption::QStyleOption ( QCheckListItem * i ) Pass a QCheckListItem, i. QStyleOption::QStyleOption ( Qt::ArrowType a ) Pass an Qt::ArrowType, a. QStyleOption::QStyleOption ( const QRect & r ) Pass a QRect, r. QStyleOption::QStyleOption ( QWidget * w ) Pass a QWidget, w. Qt::ArrowType QStyleOption::arrowType () const Returns an arrow type if the appropriate constructor was called; otherwise the return value is undefined. QCheckListItem * QStyleOption::checkListItem () const Returns a check list item if the appropriate constructor was called; otherwise the return value is undefined. const QColor &; QStyleOption::color () const Returns a color if the appropriate constructor was called; otherwise the return value is undefined. int QStyleOption::frameShadow () const Returns a QFrame::Shadow value if the appropriate constructor was called; otherwise the return value is undefined. int QStyleOption::frameShape () const Returns a QFrame::Shape value if the appropriate constructor was called; otherwise the return value is undefined. bool QStyleOption::isDefault () const Returns TRUE if the option was constructed with the default constructor; otherwise returns FALSE. int QStyleOption::lineWidth () const Returns the line width if the appropriate constructor was called; otherwise the return value is undefined. QListViewItem * QStyleOption::listViewItem () const Returns a QListView item if the appropriate constructor was called; otherwise the return value is undefined. int QStyleOption::maxIconWidth () const Returns the maximum width of the menu item check area if the appropriate constructor was called; otherwise the return value is undefined. QMenuItem * QStyleOption::menuItem () const Returns a menu item if the appropriate constructor was called; otherwise the return value is undefined. int QStyleOption::midLineWidth () const Returns the mid-line width if the appropriate constructor was called; otherwise the return value is undefined. QRect QStyleOption::rect () const Returns a rectangle if the appropriate constructor was called; otherwise the return value is undefined. QTab * QStyleOption::tab () const Returns a QTabBar tab if the appropriate constructor was called; otherwise the return value is undefined. int QStyleOption::tabWidth () const Returns the tab indent width if the appropriate constructor was called; otherwise the return value is undefined. QWidget * QStyleOption::widget () const Returns a pointer to a widget if the appropriate constructor was called; otherwise the return value is undefined. SEE ALSO
http://doc.trolltech.com/qstyleoption.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qstyleoption.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QStyleOption(3qt)
All times are GMT -4. The time now is 04:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy