Code that will sift through waves in a table

I am trying to write a code that will essentially produce:

for every wave in Table0:
n=5
wave(n) = wave(n)/wave(0)
n=n+1

I know that is not in the right format but I hope it's understandable... The problem is, I have 1000 waves in the table I am working with and I don't know how to sift through them using the same equation on all of them.

Help is much appreciated! And I can try to expand further if this is too vague of a description

Thanks!
Elaina
I'm not sure I understand what you want but here is something that might be close:

// For each wave in top table, divide points 5 through the end of the wave
// by the value of point 0.
Function Demo()
	String tableName = WinName(0, 2, 1)
	if (strlen(tableName) == 0)
		Abort "There are no tables."
	endif

	Variable index = 0
	do
		Wave/Z w = WaveRefIndexed(tableName, index, 1)
		if (!WaveExists(w))
			break		// No more waves
		endif
		
		Variable firstVal = w[0]
		
		Variable numPoints = numpnts(w)
		w[5,numPoints-1] /= firstVal
		
		index += 1
	while(1)
End