Sponsored Content
Top Forums Shell Programming and Scripting multiple search separated by blank line Post 302270587 by reddyrajal on Monday 22nd of December 2008 08:21:35 AM
Old 12-22-2008
cat file

Enter value for authid: 560000
SQL RUN TIME--- 22-12-2008 13:57:29
@lienup.sql SELECTED VALUE
Enter value for authid: 560000
SQL RUN TIME--- 22-12-2008 13:57:29
@lienup.sql SELECTED VALUE

Enter value for authid: 560001
SQL RUN TIME--- 22-12-2008 13:57:30
@lienup.sql SELECTED VALUE
Enter value for authid: 560001
SQL RUN TIME--- 22-12-2008 13:57:30
@lienup.sql SELECTED VALUE


Enter value for authid: 560002
SQL RUN TIME--- 22-12-2008 13:57:40
@lienup.sql SELECTED VALUE
Enter value for authid: 560002
SQL RUN TIME--- 22-12-2008 13:57:40
@lienup.sql SELECTED VALUE


Enter value for authid: 560003
SQL RUN TIME--- 22-12-2008 13:57:50
@lienup.sql SELECTED VALUE
Enter value for authid: 560003
SQL RUN TIME--- 22-12-2008 13:57:50
@lienup.sql SELECTED VALUE



grep -A 3 ^$ file | egrep 'Enter|SQL RUN|@'
Enter value for authid: 560000
SQL RUN TIME--- 22-12-2008 13:57:29
@lienup.sql SELECTED VALUE
Enter value for authid: 560001
SQL RUN TIME--- 22-12-2008 13:57:30
@lienup.sql SELECTED VALUE
Enter value for authid: 560002
SQL RUN TIME--- 22-12-2008 13:57:40
@lienup.sql SELECTED VALUE
Enter value for authid: 560003
SQL RUN TIME--- 22-12-2008 13:57:50
@lienup.sql SELECTED VALUE


or try this grep -A 10 ^$ file | egrep -m 3 'Enter|SQL RUN|@'

Last edited by reddyrajal; 12-23-2008 at 02:58 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print lines after the search string until blank line is found

All I want is to look for the pattern in the file...If I found it at # places... I want print lines after those pattern(line) until I find a blank line. Log EXAMPLE : MT:Exception caught The following Numbers were affected: 1234 2345 2346 Error java.lang.InternalError:... (3 Replies)
Discussion started by: prash184u
3 Replies

2. Shell Programming and Scripting

how to append blank line in multiple files in unix

Dear All- Please suggest a single unix command which can append blank line in multiple files. I need to achieve this using a single unix command and not a script Please do advice Regards, Suresh (2 Replies)
Discussion started by: sureshg_sampat
2 Replies

3. Shell Programming and Scripting

Text file to CSV with field data separated by blank lines

Hello, I have some data in a text file where fields are separated by blank lines. There are only 6 fields however some fields have several lines of data as I will explain. Also data in a particular field is not consistently the same size but does end on a blank line. The first field start with... (6 Replies)
Discussion started by: vestport
6 Replies

4. Shell Programming and Scripting

Need to remove a selection of rows separated by blank lines

hello, here is an example: 9.07 9.05 0.00 2.28 0.00 0.08 1.93 3.62 10.97 12.03 12.03 0.00 2.73 0.00 0.07 (3 Replies)
Discussion started by: Baron1
3 Replies

5. Shell Programming and Scripting

String search and print next all lines in one line until blank line

Dear all I want to search special string in file and then print next all line in one line until blank lines come. Help me plz for same. My input file and desire op file is as under. i/p file: A1/EXT "BSCABD1_21233G1" 757 130823 1157 RADIO X-CEIVER ADMINISTRATION BTS EXTERNAL FAULT ... (7 Replies)
Discussion started by: jaydeep_sadaria
7 Replies

6. Shell Programming and Scripting

Multiple line search, replace second line, using awk or sed

All, I appreciate any help you can offer here as this is well beyond my grasp of awk/sed... I have an input file similar to: &LOG &LOG Part: "@DB/TC10000021855/--F" &LOG &LOG &LOG Part: "@DB/TC10000021852/--F" &LOG Cloning_Action: RETAIN &LOG Part: "@DB/TCCP000010713/--A" &LOG &LOG... (5 Replies)
Discussion started by: KarmaPoliceT2
5 Replies

7. Shell Programming and Scripting

Combining multiple block of lines in one comma separated line

Hi Everyone, On my Linux box I have a text file having block of few lines and this block lines separated by one blank line. I would like to format and print these lines in such a way that this entire block of lines will come as single comma separated line & again next block of lines in next... (7 Replies)
Discussion started by: gr8_usk
7 Replies

8. Shell Programming and Scripting

Search words in multiple file line by line

Hi All I have to search servers name say like 1000+ "unique names" line by line in child.txt files in another file that is a master file where all server present say "master.txt",if child.txt's server name matches with master files then it print yes else no with server name. (4 Replies)
Discussion started by: netdbaind
4 Replies

9. UNIX for Dummies Questions & Answers

How to delete blank line/s before and after a search pattern?

Hi, Test file x.txt below. This file is generated by a program that I unfortunately do not have control on how it gets presented/generated. create PACKAGE "XXX_INTERFACE_DEFECT_RPT_TEST" is TYPE refCursor IS REF CURSOR; Function queryRecords ( p_status varchar2, ... ... ... )... (4 Replies)
Discussion started by: newbie_01
4 Replies

10. Shell Programming and Scripting

In a file, replace blank line by the last line not blank above

Dear All, In a CSV file, say that a given column has been extracted. In that column, information is missing (i.e. blank lines appear). I would like to replace the blank lines by the last valid line (not blank) previously read. For example, consider the extract below: 123 234 543 111... (7 Replies)
Discussion started by: bagvian
7 Replies
isql(1) 							UnixODBC Reference							   isql(1)

NAME
isql - utility to submit SQL queries to a data source. iusql - Unicode version of isql. SYNOPSIS
isql DSN [UID [PWD]] [options] DESCRIPTION
isql can be used to submit SQL to a data source and to format/output results. It can be used in batch or interactive mode. OPTIONS
DSN Name of the data source you want to connect to. UID Your login to connect the DSN. PWD Your password needed to login to the DSN. -b Batch mode. It will not do any prompting. -dx Delimit columns with x. -x0xXX Delimit columns with XX, where XX is in hex. For example -x0x09 will use a tab. -w Wrap results in an HTML table -c Print column names on first row. This options only has effect in combination with the -d option. -mn Limit column display width to n -v Verbose output. --version This prints the version. EXAMPLES
cat My.sql | isql WebDB MyID MyPWD -w Each line in My.sql must contain exactly 1 SQL command except for the last line which must be blank. AUTHOR
This manual page was written by Kurt Roeckx <kurt@roeckx.be> for the Debian package of unixODBC. UnixODBC Dec 2004 isql(1)
All times are GMT -4. The time now is 04:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy