• Post Reply Bookmark Topic Watch Topic
  • New Topic

Looking for utility program find strings..  RSS feed

 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
We have a project that has lot of java code, I have a text file that has all the stored procedures and funcions like this :
TextAll.txt :
storedpro1
storedpro2
...
function1
function2
function3
...

I need a program that has two inputs :

TextAll.txt
and
Directory of the project (example :C:\myproject)

The output will be a text file called OnlyUsedInCode.txt

I will appreciate if you know a program utility that does that.

Thanks
 
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The output will be a text file called OnlyUsedInCode.txt

And what would be in this file?
 
majid nakit
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The output text file will have :

for example if in the all files the only stored pro and function found are :
storedpro2
function1
function5

The output file will have these lines :
storedpro2
function1
function5

thanks
 
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what would be your definition of a stored procedure? Or a function? To be more specific, what should this utility look for?

Henry
 
majid nakit
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your time,

This utility will scan and parse a directory (that has lot of subdirectories and files) against a text file (that has each line is a string ) and the results will be two text files, one has lines, each line is a string that it FOUND, the other text file has strings that it DID NOT FIND.

Thanks, your help is appreciated.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think what Henry is getting at is this: A simple search for a particular string -which happens to be a procedure name- might not be sufficient, since that string could also be part of a comment. So in the worst case, you'd have to have an actual parser for whatever syntax those file contain, in order to distinguish proper occurrences from "fake" occurrences. Or are you saying that a simple string search would in all cases be sufficient?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!