Two solutions using awk and gawk
With awk :
With gawk :
Inputfile:
Output:
Jean-Pierre.
Thanks for wonderful response. This is working fine for me, however I forget to mention one this, i.e. it could be "procedure" or "function". I need to consider both, however above code only taking care of "procedure". Pls find the latest file and expected output.
Expected output:
procedure test1
function test2
procedure test3
File Contain:
procedure test1
insert into xyz;
end;
hi all,
i would like to search in a directory. all files they were found shoul be opend and looked about a keyword. if keyword is found i want to see the name of the file. i've rtfm of find and have a command like this :
find /etc -exec cat \{}\ | grep KEYWORD
but don't work, and :
find... (4 Replies)
Hi,
I have a file which contains the following :
select * from test where test_id=1;
select id
from test1, test2 where test_id=1 and test_id=2;
select * from
test1, test2, test3 where test_id=4 and test2_id where in (select test2_id from test2);
select
id1, id2 from test ... (6 Replies)
I've following sed command working fine -
sed '/search_pattern1/ !s/pattern1/pattern2/" file
Now, I want to search two patterns - search_pattern1 and search_pattern2 .
How can put these into above sed statement ?
Thanks in advance. (12 Replies)
hi,
I have a doubt. how we can remove few words based on search.
here im specifying my requirement with example.
ALL the words should delete between two words ...
those words will ends **
EX : cat infile.txt
"HI",ob1**,ob2,ob3,ob4**,ob5,ob6
OUTPUT... (2 Replies)
Hi Friends,
I have been trying to write the script since morning and reached some where now. but i think i am stuck in the final step. please help
I want to search the strings below in red in the be be searched in the directories below. How can i do that in my shell script.
Thanks
Adi
... (8 Replies)
Hello,
I'm trying to write a bash script that will search for words from one list that may be found in another list. Once the record is found, it will create a new text file for each word.
For example, list1.txt contains the following:
Dog
Cat
Fish
List2.txt contains
Dog - Buddy 14... (3 Replies)
Hello,
I try to print out with sed or awk the 21.18 between "S3 Temperature" and "GrdC" in a text file.
The blanks are all real blanks no tabs.
Only the two first chars from temperture are required. So the "21" i need as output.
S3 Temperatur 21.18 GrdC No Alarm
... (3 Replies)
Hi,
Need your help for this scripting issue I have. I am not really good at this, so seeking your help.
I have a file looking similar to this:
Hello, i am human and name=ABCD.
How are you?
Hello, i am human and name=PQRS.
I am good.
Hello, i am human and name=ABCD.
Good bye.
Hello, i... (12 Replies)
hi,
i need to replace all words in any quote position and then need to change the words inside the file thousand of raw.
textfile data :
"Ninguno","Confirma","JuicioABC"
"JuicioCOMP","Recurso","JuicioABC"
"JuicioDELL","Nulidad","Nosino"
"Solidade","JuicioEUR","Segundo"
need... (1 Reply)
Discussion started by: benjietambling
1 Replies
LEARN ABOUT DEBIAN
ns_setconnlocationproc
Ns_Location(3aolserver) AOLserver Library Procedures Ns_Location(3aolserver)__________________________________________________________________________________________________________________________________________________NAME
Ns_SetConnLocationProc, Ns_SetLocationProc - Set the location procedure to use
SYNOPSIS
#include "ns.h"
void
Ns_SetConnLocationProc(Ns_LocationProc *procPtr)
void
Ns_SetLocationProc(char *ignored, Ns_LocationProc *procPtr)
_________________________________________________________________DESCRIPTION
These functions set the procedure to run when a call to Ns_ConnLocation is made. The location is defined in the form METHOD://HOST-
NAME:PORT, e.g. http://myhost.com:8443.
Setting the location procedure with these functions will cause all calls to Ns_ConnLocation to use the location procedure you define
instead of using the location procedure callback in the communication module for the connection.
There may be cases where you want to do this. For example, you could create a location procedure that reports on the values returned by
communication module location procedure callbacks. At the end of that procedure, you could then return that value after logging the infor-
mation making your location procedure is effectively transparent to the server and other modules.
Ns_SetConnLocationProc(procPtr)
Set the function to use when Ns_ConnLocation is called. This function is deprecated. Use Ns_SetLocationProc instead.
Ns_SetLocationProc(ignored, procPtr)
Set the function to use when Ns_ConnLocation is called. The ignored argument is reserved for future use.
SEE ALSO nsd(1), info(n), Ns_ConnLocation(3)KEYWORDS AOLserver 4.0 Ns_Location(3aolserver)