remove lines starting with


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting remove lines starting with
# 1  
Old 10-19-2010
remove lines starting with

Hi
I have an input file...
Code:
/* ----------------- AGYDLY_Box ----------------- */
insert_job: AGYDLY_Box job_type: b
owner: spdrdev
permission: gx,wx
date_conditions: 1
days_of_week: mo,tu,we,th,fr
exclude_calendar: mtg_holidays
start_times: "1:00"
description: "Process Daily New pools agency data"
alarm_if_fail: 1
/* ----------------- AGYDLY_PoolsAvlBal ----------------- */
insert_job: AGYDLY_PoolsAvlBal job_type: c
box_name: AGYDLY_Box
command: $AGENCY_SCRIPTS/mfa_pools_avlbal.sh get
machine: pimbslxprd01
owner: spdrdev
permission: gx,wx
description: "Updates the avlbal field only on the pools table for all agencies"
std_out_file: > ${AGENCY_AUTOSYS_LOGS}/${AUTO_JOB_NAME}
std_err_file: > ${AGENCY_AUTOSYS_ERRS}/${AUTO_JOB_NAME}
alarm_if_fail: 1
profile: /home/spdrdev/dev/pkgs/SPDR/AGENCY/dev/config/agency.env
/* ----------------- AGYDLY_PoolsDbToSas ----------------- */
insert_job: AGYDLY_PoolsDbToSas job_type: c
box_name: AGYDLY_Box
command: $AGENCY_SCRIPTS/daily_db_tables.sh
machine: njfimtgsaslx03
owner: spdrdev
permission: gx,wx
condition: success(AGYDLY_PoolsAvlBal)
std_out_file: > ${AGENCY_AUTOSYS_LOGS}/${AUTO_JOB_NAME}
std_err_file: > ${AGENCY_AUTOSYS_ERRS}/${AUTO_JOB_NAME}
alarm_if_fail: 1
profile: /home/spdrdev/dev/pkgs/SPDR/AGENCY/dev/config/agency.env

I need to remove lines starting with
Code:
alarm_if_fail:
box_name:
date_conditions:
days_of_week:
exclude_calendar:
owner:
permission:
profile:
start_times:


Last edited by Scott; 10-19-2010 at 03:34 PM.. Reason: Code tags, please...
# 2  
Old 10-19-2010
Code:
awk '!/^alarm_if_fail:/&&!/^box_name:/&&!/^date_conditions:/&&!/^days_of_week:/&&!/^exclude_calendar:/&&!/^owner:/&&!/^permission:/&&!/^profile:/&&!/^start_times:/' yourfile

# 3  
Old 10-19-2010
Thanks for the quick response, but this did not work, i got the following error message

/: Event not found.

---------- Post updated at 02:16 PM ---------- Previous update was at 02:00 PM ----------

hey... this works... I have tried it and it works now...
thanks so much.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Need to remove lines starting with an ID from all fine in a director

Hi All, I have almost 200 files in a directory I want to remove all lines in each file that is starting with 88002 and 88003. I tried with grep -v and if I plan to do that I need to for all the files individually and it is 200+ files. Any way I can do at single command ... (4 Replies)
Discussion started by: arunkumar_mca
4 Replies

2. UNIX for Dummies Questions & Answers

How to grep a line not starting with # from a file (there are two lines starting with # and normal)?

e.g. File name: File.txt cat File.txt Result: #INBOUND_QUEUE=FAQ1 INBOUND_QUEUE=FAQ2 I want to get the value for one which is not commented out. Thanks, (3 Replies)
Discussion started by: Tanu
3 Replies

3. Shell Programming and Scripting

Remove duplicate line starting with a pattern

HI, I have the below input file /* ----------------- cmdsDlyStartFWJ -----------------*/ UNIX_JOB CMDS065J RUN ANY CMDNAME sleep 5 AGENT CMDSHP USER proddata RUN MON,TUE,WED,THU,FRI DELAYSUB 02:00 /* "Triggers daily file watcher jobs" */ ENVAR... (5 Replies)
Discussion started by: varun22486
5 Replies

4. Shell Programming and Scripting

Remove all lines except lines starting with [

Hello, I am trying to remove all the lines in file except lines starting with [ How can i accomplish this? Thank you very much in advance. (4 Replies)
Discussion started by: maxo
4 Replies

5. Shell Programming and Scripting

Concatenate lines between lines starting with a specific pattern

Hi, I have a file such as: --- >contig00001 length=35524 numreads=2944 gACGCCGCGCGCCGCGGCCAGGGCTGGCCCA CAGGCCGCGCGGCGTCGGCTGGCTGAG >contig00002 length=4242 numreads=43423 ATGCCGAAGGTCCGCCTGGGGCTGG CGCCGGGAGCATGTAGCG --- I would like to concatenate the lines not starting with ">"... (9 Replies)
Discussion started by: s052866
9 Replies

6. Shell Programming and Scripting

Remove field starting with * and #

Hi i have file with data: abc,*xyz,#abc 123,#123,1234 *123,#123,abc So i want to remove only fields starting with * and # and i want output as: abc,, 123,,1234 ,,abc Please suggest something Thanks Sumit (3 Replies)
Discussion started by: sumit207
3 Replies

7. Shell Programming and Scripting

shell script to remove all lines from a file before a line starting with pattern

hi,, i hav a file with many lines.i need to remove all lines before a line begginning with a specific pattern from the file because these lines are not required. Can u help me out with either a perl script or shell script example:- if file initially contains lines: a b c d .1.2 d e f... (2 Replies)
Discussion started by: raksha.s
2 Replies

8. UNIX for Dummies Questions & Answers

remove lines in text starting with . (period)

how can i remove lines from a text file starting with . (a period) (11 Replies)
Discussion started by: Movomito
11 Replies

9. Shell Programming and Scripting

How to remove files starting with -

Hi, Can anyone suggest me how to remove the file whose name starts with "-". Say i have a file by name -out. I want to remove this. I tried escaping -, but didnt work. I work on AIX 5.3 machine. Thanks in advance. Suman (5 Replies)
Discussion started by: suman_jakkula
5 Replies

10. UNIX for Advanced & Expert Users

How To Remove files starting with -

In Unix/Linux when u create a file starting with a - e.g.-file then when u try to remove or rename it, it is not possible. e.g. rm -file . when we give this command rm assumes to be its option rather than its argument. Same is the case when this filename is given as an argument to mv or cat and... (2 Replies)
Discussion started by: rahulrathod
2 Replies
Login or Register to Ask a Question