To select a script name till .ksh or .sh

Hi All,
My requirement is to search for a Table Name [or other objects] being used in list of script placed at a dir path :
we are using below command to get the desired result :

grep -H -i <Table_name> <dir_path>/* -r|awk '{print $1}'| uniq -d

#It gives me below result 
/infa/server/bin/sam/scripts/my_script.ksh:PARAM 
/infa/server/bin/sam/scripts/your_script.sh:VARIABLE  

Now my requirement is to get rid of those extra characters after .ksh or .sh. I could get the file_name from above command and redirect the same to temp file and using while loop can get rid of extra characters using ${STRING%.ksh} or ${STRING%.sh} . But there is anything we can append to above command to make it in one shot.
Kindly assist. Any help is appreciated.

Ugly but Im a bit tired... and lack of imagination...So I will add after your code:

grep -H -i <Table_name> <dir_path>/* -r|awk '{print $1}'| uniq -d | cut -d : -f 1 

silly mistake but you made it perfect !!! Thanks my bro !!

Something like this?
-l option will list the files uniquely
-H may not be required
You can avoid the * at the end of <dir_path>

grep -irl <Table_name> <dir_path>

HTH
--ahamed