how to get a part of file pertaining to a condition


 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications how to get a part of file pertaining to a condition
# 1  
Old 01-09-2008
how to get a part of file pertaining to a condition

A log file contains details for last one year .This file contains log for all dates . The log file for a particular day starts with a particular string and ends with the same string .
We need to make a new file out of this existing file containing data after a particular date.
# 2  
Old 01-09-2008
after which date ? what applications is writing to this log file ? what is the OS ? what languages (if) need to be deployed ? are you root ? Please post more details with some samples.
# 3  
Old 01-09-2008
Quote:
Originally Posted by sysgate
after which date ? what applications is writing to this log file ? what is the OS ? what languages (if) need to be deployed ? are you root ? Please post more details with some samples.
********************************************************we need to retain the log for last one month
applicaton writing is: Abinito
NO we are not the root.




here is a part of the log


--------------------------------------------------------------------------------
Data Bytes Records Status Skew Flow
Vertex Port
--------------------------------------------------------------------------------
Apr 05 11:24:58 Phase 4 ended (3 seconds)
CPU Time Status Skew Vertex
0.330 [ : 1] 0% Job_Audit_Complete.gatherlg_log
0.340 [ : 1] 0% Job_Audit_Complete.gatherlg_log_1
0.540 [ : 1] 0% Job_Audit_Complete.gen_rec_job_audit
0.360 [ : 1] 0% Job_Audit_Complete.reformat_job_audit
1.140 [ : 1] 0% Job_Audit_Complete.updtab_job_audit
--------------------------------------------------------------------------------
Data Bytes Records Status Skew Flow
Vertex Port
112 1 [ : : 1] 0% Job_Audit_Complete.Flow_1
Job_Audit_Complete.gen_rec_job_audit out
112 1 [ : : 1] 0% Job_Audit_Complete.Flow_1
Job_Audit_Complete.reformat_job_audit in
77 1 [ : : 1] 0% Job_Audit_Complete.Flow_2
Job_Audit_Complete.reformat_job_audit out0
77 1 [ : : 1] 0% Job_Audit_Complete.Flow_2
Job_Audit_Complete.updtab_job_audit in
337 2 [ : : 1] 0% Job_Audit_Complete.Flow_3
Job_Audit_Complete.reformat_job_audit log
337 2 [ : : 1] 0% Job_Audit_Complete.Flow_3
Job_Audit_Complete.gatherlg_log in
4,395 27 [ : : 1] 0% Job_Audit_Complete.Flow_4
Job_Audit_Complete.updtab_job_audit log
4,395 27 [ : : 1] 0% Job_Audit_Complete.Flow_4
Job_Audit_Complete.gatherlg_log_1 in
------------------------------------------------------------------------
++GTR++;J4,-1;--GTR--


this is a part of the log
basing on the date condition we need to get the log for last one month
++GTR++;J4,-1;--GTR-- is the ending string for a particular days log
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to make a loop to read the input from a file part by part?

Hi All, We've a VDI infrastructure in AWS (AWS workspaces) and we're planning to automate the process of provisioning workspaces. Instead of going to GUI console, and launching workspaces by selecting individual users is little time consuming. Thus, I want to create them in bunches from AWS CLI... (6 Replies)
Discussion started by: arun_adm
6 Replies

2. Shell Programming and Scripting

Remove part of the file using a condition

Gents, Is there the chance to remove part of the file, Taking in consideration this condition. For each record the first row start with the string % VE should be 56 rows for each records.. first row = % VE last row = % sw total 56 rows for each record. Then in the case that the... (4 Replies)
Discussion started by: jiam912
4 Replies

3. Shell Programming and Scripting

If condition return 0 even when it fails to satisfy te condition

HI My doubt may be basic one but I need to get it clarified.. When i use "if" condition that checks for many AND, OR logical conditions like if ]; then return 0 fi Even the if condition fails it returns as zero.. Any clue.. But if i add else condition like if ]; ... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies

4. Shell Programming and Scripting

[Solved] Printing a part of the last line of the specific part of a file

Hi, I have 80 large files, from which I want to get a specific value to run a Bash script. Firstly, I want to get the part of a file which contains this: Name =A xxxxxx yyyyyy zzzzzz aaaaaa bbbbbb Value = 57 This is necessary because in a file there are written more lines which... (6 Replies)
Discussion started by: wenclu
6 Replies

5. Shell Programming and Scripting

redirect stdout echo command in condition A run in condition B

hi, I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command Here are my simple script After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
Discussion started by: jao_madn
3 Replies

6. HP-UX

Difference between [condition] and [[condition]] and ((condition)) when used with if condition

Executed the following if conditions .. and got different results . only (( )) gave correct o/p with all scenarios . Can anybody please let me know what is the difference between and ] and ((condition)) when used with if condition. And why each condition gave different result. 1.... (2 Replies)
Discussion started by: soumyabubun
2 Replies

7. Shell Programming and Scripting

If condition to check one file newer than the other - first file name uncertain

Dear All, I'm new to unix scripting. I'm trying to write an utility script which has to check if one file is newer than another one. The condition is I dont know the full name of the first file. I searched google and this forum for any such examples, but couldn't find any or may be I would have... (9 Replies)
Discussion started by: achilles5
9 Replies

8. UNIX for Dummies Questions & Answers

need to fetch the ip address pertaining to the modified file

hi all i need to find the ip address related to the modified files ... since the user id for all is the same in the server i am operating with, making file monitoring difficult.... if a file is midified then the ip address of the person who does the change should be logged in.... is there any... (2 Replies)
Discussion started by: sais
2 Replies

9. UNIX for Advanced & Expert Users

How to parse through a file and based on condition form another output file

I have one file say CM.txt which contains values like below.Its just a flat file 1000,A,X 1001,B,Y 1002,B,Z ... .. total around 4 million lines of entries will be in that file. Now i need to write another file CM1.txt which should have 1000,1 1001,2 1002,3 .... ... .. Here i... (6 Replies)
Discussion started by: sivasu.india
6 Replies
Login or Register to Ask a Question