Sponsored Content
Top Forums Shell Programming and Scripting Need to check a file from a certain position and date onwards Post 302623125 by Junes on Friday 13th of April 2012 07:17:08 AM
Old 04-13-2012
panyam,

Can you explain to me how i should enter this into the script.

Code:
xargs -l4 <  input_file | grep `date "+%m/%d/%y"` | sed 's/.*Set/Set/'


The script should read the file below looking for the current date and grab only "Set owner ". So from the example below is should grab CBL288 and not CBLJMM..

File Read - /tmp/test


Code:
$ cat /tmp/test
04/12/12 15:10:25
volume: CBLJMM
Remove prior owner SYSTEM from CBLJMM
Set owner nbkpmstr to CBLJMM

04/13/12 15:10:14
volume: CBL288
Remove prior owner SYSTEM from CBL288
Set owner nbkpmstr to CBL288

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

file date check script

I am creating a KSH script and need to check the filedate against the system date. I can get the sys date w. date command, and I was able to get the filedate w. the awk command but when I compare them w. an if condition statement I get syntax error. Not sure what's wrong, and other suggestions on... (4 Replies)
Discussion started by: jaxconsultant
4 Replies

2. Shell Programming and Scripting

check file date in one week ???

How do you write a code in ksh ?? Enter the start date: 20060228 d0 = 20060228; 2. Check for 7 days of report list 1 day after the d0 d1 = 20060301 d2 = 20060302 d3 = 20060303 d4 = 20060304 d5 = 20060305 d6 = 20060306 then cat d0.log d1.log d2.log d3.log d4.log d5.log d6.log >... (1 Reply)
Discussion started by: sabercats
1 Replies

3. Shell Programming and Scripting

How to check a word position in a file ?

Hello everybody, I have a file like this : "window 1 truck 3 duck 2... fire 1... etc..." and I would like to print the following number of a word I am searching for. (For example here, if I search for the word "fire", I will print "1") Thank you for your help ! (7 Replies)
Discussion started by: tibo
7 Replies

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

5. Shell Programming and Scripting

Sort a file from specific row onwards

Hello All: I've file in below format. File name is "FIRSTN.TBL": AAAAAA N BBBBBBBBBBBBBBBBBBBBBBB N . . . . ZZZZZZZZZZZZZZZZZZZZZZZZZZ N My file row length is 40 characters and my second column will start from 25th column and it is only... (3 Replies)
Discussion started by: nvkuriseti
3 Replies

6. Shell Programming and Scripting

finding date numeral from file and check the validity of date format

hi there I have file names in different format as below triss_20111117_fxcb.csv triss_fxcb_20111117.csv xpnl_hypo_reu_miplvdone_11172011.csv xpnl_hypo_reu_miplvdone_11-17-2011.csv xpnl_hypo_reu_miplvdone_20111117.csv xpnl_hypo_reu_miplvdone_20111117xfb.csv... (10 Replies)
Discussion started by: manas_ranjan
10 Replies

7. Shell Programming and Scripting

Need to check a file from a certain position onwards

Scripting Guru's, I need your help, can you tell me how i can check a file from a certain point onwards via a ksh script. Currerntly i am checking the whole file and can't script it so it checks from 17.01.2012 20:00:00 onwards please.. Any help will be greatly appericated. See file... (10 Replies)
Discussion started by: Junes
10 Replies

8. Shell Programming and Scripting

Find and count unique date values in a file based on position

Hello, I need some sort of way to extract every date contained in a file, and count how many of those dates there are. Here are the specifics: The date format I'm looking for is mm/dd/yyyy I only need to look after line 45 in the file (that's where the data begins) The columns of... (2 Replies)
Discussion started by: ronan1219
2 Replies

9. UNIX for Dummies Questions & Answers

Help in script to check file name with todays date

I am trying to include a snippet in my script to check if the file created is having today's date. eg: File name is : ABC.YYYYMMDD-nnn.log The script should check if 'YYYYMMDD' in the above file name matches with today's date. Can you please help me in achieving this. Thanks in advance!! (5 Replies)
Discussion started by: kiran1112
5 Replies

10. Shell Programming and Scripting

How to check charactor in certain position?

Hi Gurus, I need to check the charactor in certain position. in my file abcdef1234gh ac1234eeeegt acdead1235gh I want to check what is check from position 7 to 10's charactor, if it is 1234, then output the whole line. for above file, I want to get below output abcdef1234gh... (2 Replies)
Discussion started by: ken6503
2 Replies
TV_GRAB_UK_BLEB(1p)					User Contributed Perl Documentation				       TV_GRAB_UK_BLEB(1p)

NAME
tv_grab_uk_bleb - Grab TV listings for the United Kingdom, from bleb.org SYNOPSIS
tv_grab_uk_bleb --help tv_grab_uk_bleb [--config-file FILE] --configure [--gui OPTION] tv_grab_uk_bleb [--config-file FILE] [--output FILE] [--quiet] [--days N] [--offset N] DESCRIPTION
Output TV and radio listings in XMLTV format for many stations available in Britain. The data comes from the bleb.org web site. USAGE
First you must run tv_grab_uk_bleb --configure to choose which stations you want to receive. Then running tv_grab_uk_bleb with no arguments will get about a week<39>s listings for the stations you chose. --configure Prompt for which stations to download and write the configuration file. --gui OPTION Use this option to enable a graphical interface to be used. OPTION may be 'Tk', or left blank for the best available choice. Additional allowed values of OPTION are 'Term' for normal terminal output (default) and 'TermNoProgressBar' to disable the use of Term::ProgressBar. --config-file FILE Set the name of the configuration file, the default is ~/.xmltv/tv_grab_uk_bleb.conf. This is the file written by --configure and read when grabbing. --output FILE When grabbing, write output to FILE rather than standard output. --days N When grabbing, grab N days rather than as many as possible. --offset N Start grabbing at today + N. N may be negative. --quiet Suppress the progress messages normally written to standard error. --version Show the version of the grabber. --help Print a help message and exit. SEE ALSO
xmltv(5), <http://www.bleb.org/> AUTHOR
Andy Balaam, axis3x3@users.sourceforge.net Icon URLs collated by Lawrence, MagicLGH@aol.com Based on tv_grab_nl_wolf by Ed Avis perl v5.14.2 2012-06-30 TV_GRAB_UK_BLEB(1p)
All times are GMT -4. The time now is 10:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy