cancel
Showing results for 
Search instead for 
Did you mean: 

search a word

 
Debasis Mishra
Occasional Advisor

search a word

i have a pro*c file which contains 6578 lines. From there i want to search a particular word and then i will do some change. So how i will do that?
6 REPLIES 6
RAC_1
Honored Contributor

Re: search a word

A simpe would do it.

grep "what_ever_u_want" file_name
There is no substitute to HARDWORK
Debasis Mishra
Occasional Advisor

Re: search a word

Thanks for help.
But i have another problem. i.e., i have declare the variable like this in pro*c

int create_mailfile(int,char*,char*,char*,char*,char*,char*);
int system_stevens(const char* cmd);
char * trim (char *);
int sequel(void);
int db_connect(void);
int commit_tran(void);
int rollback_tran(void);
void efin_trace(const char*, ...);


But i am facing error.
Arunvijai_4
Honored Contributor

Re: search a word

Hi Debasis,

You can do with "vi". Edit your Pro*C file in VI, search for any string you want to change.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: search a word

what are the errors you are getting? For search replacing in the same file use perl -pi -e 's/pattern/patterntochange/g/'

will do it.

--
Muthu
Easy to suggest when don't know about the problem!
Peter Godron
Honored Contributor

Re: search a word

Debasis,
what is the new error? I have added the main() function to your code and it compiles.

Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#28
You have assigned 0 points to 21 replies.
Debasis Mishra
Occasional Advisor

Re: search a word

The massage is coming like this

ld: Undefined symbols:
_commit_tran
_create_mailfile
_db_connect
_efin_trace
_rollback_tran
_sequel
_sqlcxt
_system_stevens
_trim