Sponsored Content
Top Forums Shell Programming and Scripting how to filter out some paragraphs in a file Post 302075966 by cnlhap on Wednesday 7th of June 2006 10:23:43 PM
Old 06-07-2006
Tools how to filter out some paragraphs in a file

Hi,

I am trying to filter out those paragraphs that contains 'CONNECT', 'alter system switch logfile'. That means say the input file is :

-------------------------------------------------------
Wed Jun 7 00:32:31 2006
ACTION : 'CONNECT'
CLIENT USER: prdadm
CLIENT TERMINAL:

Wed Jun 7 00:32:31 2006
ACTION : 'alter system switch logfile'
CLIENT USER: prdadm
CLIENT TERMINAL:


Wed Jun 7 00:32:31 2006
ACTION : 'CONNECT'
CLIENT USER: prdadm
CLIENT TERMINAL:

Wed Jun 7 00:32:42 2006
ACTION : 'ALTER DATABASE CLOSE NORMAL'
CLIENT USER: prdadm
CLIENT TERMINAL:
----------------------------------------------------------------

I would like the output file to be :

----------------------------------------------------------------
Wed Jun 7 00:32:42 2006
ACTION : 'ALTER DATABASE CLOSE NORMAL'
CLIENT USER: prdadm
CLIENT TERMINAL:
----------------------------------------------------------------

Do you have any script to perform this, thank you very much Smilie .
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to extract paragraphs from file in BASH script followed by prefix ! , !! and !!!

I]hi all i am in confusion since last 2 days :( i posted thraed yesterday and some friends did help but still i couldnt get solution to my problem let it be very clear i have a long log file of alkatel switch and i have to seperate the minor major and critical alarms shown by ! , !! and !!!... (6 Replies)
Discussion started by: nabmufti
6 Replies

2. Shell Programming and Scripting

how to sort paragraphs by date within a file

hi all i want help in sortng date in paragraphs within file , i want to ask as if there any option to sort a certain pattern of file not the rest of file.i.e the data of file become sorted with respect to date i have a log file as follows !! *A0628/081 /08-01-10/13 H... (1 Reply)
Discussion started by: nabmufti
1 Replies

3. Shell Programming and Scripting

fetching paragraphs with SED

hi, i am a SED newbie and i need some help. i have a log file as shown below. and i want to search specific Error Code, and fetch the whole paragraph. ... ... ................. ....ErrCode... ................. ... ... ... ................. ....ErrCode... ... (4 Replies)
Discussion started by: ipat
4 Replies

4. Shell Programming and Scripting

splitting a large text file into paragraphs

Hello all, newbie here. I've searched the forum and found many "how to split a text file" topics but none that are what I'm looking for. I have a large text file (~15 MB) in size. It contains a variable number of "paragraphs" (for lack of a better word) that are each of variable length. A... (3 Replies)
Discussion started by: lupin..the..3rd
3 Replies

5. Shell Programming and Scripting

file separated into paragraphs or pages

hi, i have file, file is separated into parahgraphs by these line(----------). i want to find out logId = string : "AIALARM", in each parahgraph or page if found then i want to cut next five lines.... ... (3 Replies)
Discussion started by: dodasajan
3 Replies

6. Shell Programming and Scripting

Extract paragraphs under conditions

Hi all, I want to extract some paragraphs out of a file under certain conditions. - The paragraph must start with 'fmri' - The paragraph must contain the string 'restarter svc:/system/svc/restarter:default' My input is like that : fmri svc:/system/vxpbx:default state_time Wed... (4 Replies)
Discussion started by: Armoric
4 Replies

7. Shell Programming and Scripting

Split text into paragraphs

Hi all! I want to make a code to split sentences into paragraphs maybe 4-5 sentences into one <p>text</p> there are no new lines in the text string any ideas with AWK, SSH? Thank you! (5 Replies)
Discussion started by: sanantonio7777
5 Replies

8. Shell Programming and Scripting

Need help with sorting in paragraphs

I am very new to shell scripting, current try to do a sorting of a text file in paragraphs with ksh script. example: File content: A1100001 line 1 = "testing" line 2 = something, line 3 = 100 D1200003 line 1 = "testing" line 2 = something, line 3 = 100 B1200003 line 1 =... (3 Replies)
Discussion started by: gavin_L
3 Replies

9. UNIX for Dummies Questions & Answers

Filter records in a huge text file from a filter text file

Hi Folks, I have a text file with lots of rows with duplicates in the first column, i want to filter out records based on filter columns in a different filter text file. bash scripting is what i need. Data.txt Name OrderID Quantity Sam 123 300 Jay 342 498 Kev 78 2500 Sam 420 50 Vic 10... (3 Replies)
Discussion started by: tech_frk
3 Replies

10. Shell Programming and Scripting

Extract paragraphs and count them

Hi, I have a text with a number of paragraphs in them. My problem is I need to locate certain errors/warning and extract/count them. Problem is I do not know how many paras are there with that particular type of error/warning. I had thought that somehow if I could count the number of... (25 Replies)
Discussion started by: dsid
25 Replies
NAME-CLIENT-2(1)						  [FIXME: manual]						  NAME-CLIENT-2(1)

NAME
name-client-2 - CORBA Naming Service client SYNOPSIS
name-client-2 [root] [[bind] | [rebind] | [bind_context] | [rebind_context]] [name] [object-id] name-client-2 [root] [[resolve] | [unbind] | [bind_new_context] | [list] | [destroy]] [name] name-client-2 [root] [new_context] DESCRIPTION
name-client-2 is used to query or control a CORBA Name Service, such as the orbit-name-server-2. OPTIONS
name-client-2 accepts the following arguments: Binds or rebinds an object or naming context to name. Resolves, unbinds, lists, or destroys name or binds name to a new context. Creates a new naming context and writes its IOR to standard output. Components of name are delimited by / (slash). id and kind of those components are delimited by . (dot). root denotes the IOR of the root naming context, it is either: o the IOR itself o --stdin: the IOR is read from stdin. o --gnome: the GNOME Name Server is used. object-id is the IOR of an object. FILES
On startup, name-client-2 tries to read the files /etc/orbitrc and $HOME/.orbitrc. The format of these files is not yet documented in Debian. SEE ALSO
ORBit2 web pages: GNOME[1], SourceForge[2] AUTHORS
This manual was written by W. Borgert for Debian GNU/Linux. AUTHOR
W. Borgert <debacle@debian.org> Author. COPYRIGHT
Copyright (C) 2003 W. Borgert NOTES
1. GNOME http://www.gnome.org/projects/ORBit2/ 2. SourceForge http://orbit-resource.sourceforge.net/ [FIXME: source] 2003-12-12 NAME-CLIENT-2(1)
All times are GMT -4. The time now is 01:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy