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 OSF1
ldgetpd
ldgetpd(3) Library Functions Manual ldgetpd(3)NAME
ldgetpd - Retrieves procedure descriptor given a procedure descriptor index
SYNOPSIS
#include <stdio.h> #include <filehdr.h> #include <sym.h> #include <ldfcn.h>
long ldgetpd (ldptr, ipd, ppd ) LDFILE ldptr ; long ipd ; pPDR ipd ;
DESCRIPTION
The ldgetpd routine returns a SUCCESS or FAILURE depending on whether the procedure descriptor with index ipd can be accessed. If it can
be accessed, the structure pointed to by ppd is filled with the contents of the corresponding procedure descriptor. The isym, iline, and
iopt fields of the procedure descriptor are updated to be used in further LD routine calls. The adr field is updated from the symbol refer-
enced by the isym field.
The PDR cannot be retrieved when: The procedure descriptor table cannot be found. The ipd offset into the procedure descriptor table is
beyond the end of the table. The file descriptor that the ipd offset falls into cannot be found.
Typically, ldgetpd is called while traversing the table that runs from 0 to SYMHEADER(ldptr).ipdMax - 1.
The program must be loaded with the object file access routine library libmld.a.
RELATED INFORMATION ldclose(3), ldopen(3), ldtbseek(3), ldtbread(3), ldfcn(4). delim off
ldgetpd(3)