MelaOS 0 Newbie Poster

Hi All,

I am currently trying to create a perl script that takes sql statement that is stored within text files and add up the frequency for that sql statement in that text file and store the sql statement and the no of frequency in another file.

Below is a sample of the sql statement that i would be capturing.

SELECT F_PRODUCT.BUILDING, F_PRODUCT.TESTER, PEDB.Name, PEDB.Email, T1.Name AS PLMName, T1.Email AS PLMEmail, PEDB_1.Name AS QREName, PEDB_1.Email AS QREEmail,

The thing is, there's too much variety to do a efficient pattern matching on these statements.

So would it be possible to first add a " in front of each statement and a " at the back of each statement, and then by using " " as a delimiter i can take whatever sql statement that is found between two ", and use that to compare to other statements in the line to get the frequency and finally storing that statement along with it's no of frequency on another text file.

If you know of any better way or if there's already actual program/scripts that does that, pls advise.

Thank you for your time and attention.