How to use awk shell script to compare and match two files?

Basically, I have two files

dupestest.txt
  152,153
  192,193,194
  215,216
  290,291
  2279,2280 2282,2283
haftest.txt
  152,ABBOTS ROAD
  153,ABBOTS ROAD
  154,ABBOTS ROAD
  155,ABBOTS ROAD
  156,ABBOTS ROAD
  157,ABBOTS ROAD

I want to find the numbers in dupestest.txt in haftest.txt and produce this outcome: results.txt

152,ABBOTS ROAD,153 ABBOTS ROAD
192,ABBOTS ROAD, 193,ABBOTS ROAD, 194,ABBOTS ROAD

etc

(the numbers are just the count they are not premise numbers)

I have been told to try

awk -F, 'BEGIN{OFS=","} FNR==NR{a[$1]=$2; next} $1 in a || $2 in a{print $1, a[$1], $2, a[$2]}' haftest.txt dupestest.txt

But I want to do it in Notepad and save it as a AWK file instead of just a command line.I am totally new to AWK and have started with this:

BEGIN
{
OFS=",";

} 

FNR==NR

{

street[$1]=$2

}



End

Can anyone give me any advice?

It has to be in awk.

I have a question regarding your required output:

152,ABBOTS ROAD,153 ABBOTS ROAD
192,ABBOTS ROAD, 193,ABBOTS ROAD, 194,ABBOTS ROAD

How you got 192, 193, 194 in the output? I don't see these numbers in file: haftest.txt

Thats just a cut out of the HAF. The HAF is 4gb worth of data so it is in there just not on the bit I have posted.

---------- Post updated at 08:46 AM ---------- Previous update was at 08:45 AM ----------

All the data in the dupes will match up to a number in the HAF.

I still don't get it!

If you are trying to join 2 files using 1st field, you could do something like:

awk '
        NR == FNR {
                D[$0]
                next
        }
        {
                for ( k in D )
                {
                        n = split ( k, V, "," )
                        for ( i = 1; i <= n; i++ )
                        {
                                split ( $0, T, "," )
                                if ( V == T[1] )
                                {
                                        s = s ? s OFS $0 : $0
                                }
                        }
                        if ( s )
                                print s
                        s = ""
                }
        }
' OFS=, dupestest.txt haftest.txt

This is more of the HAF:

272,ABBOTS ROAD                                                                   
273,ABBOTS ROAD                                                                   
274,ABBOTS ROAD                                                                   
275,ABBOTS ROAD                                                                   
276,ABBOTS ROAD                                                                   
277,ABBOTS ROAD                                                                   
278,ABBOTS ROAD                                                                   
279,ABBOTS ROAD                                                                   
280,ABBOTS ROAD                                                                   
281,ABBOTS ROAD                                                                   
282,ABBOTS ROAD                                                                   
283,ABBOTS ROAD                                                                   
284,ABBOTS ROAD                                                                   
285,ABBOTS ROAD                                                                   
286,ABBOTS ROAD                                                                   
287,ABBOTS ROAD                                                                   
288,ABBOTS ROAD                                                                   
289,ABBOTS ROAD                                                                   
290,ABBOTS ROAD                                                                   
291,ABBOTS ROAD                                                                   
292,ABBOTS ROAD                                                                   
293,ABBOTS ROAD                                                                   
294,ABBOTS ROAD                                                                   
295,ABBOTS ROAD                                                                   
296,ABBOTS ROAD                                                                   
297,ABBOTS ROAD                                                                   
298,ABBOTS ROAD                                                                   
299,ABBOTS ROAD                                                                   
300,ABBOTS ROAD                                                                   
301,ABBOTS ROAD    

Its just a list of streets with a count at the beggining