DATExecute: cross reference 2 tables and populate a third

Hi Guys,

So I need to write some Python in a DATExecute Dat in the onCellChange method.

the 1st Dat is a list of letters that is changeable. i.e. text input seperated to a column.
the 2nd Dat is a list of the letters a-z in col1 and files in col 2.

I want Dat3 to have the list of files from Dat2 col2 for each letter in Dat1.

Before I go too far here is my starting code maybe someone can help me fill this in:

‘dat’ is the same as the ‘letter’ variable but for understanding i made it a variable. therfore cells is the array of cells in ‘letters’.

[code]def onCellChange(dat, cells, prev):

letter = op('lettersFinal')
fileList = op('filesList')
out = op('SelectedLetterList')

for a in cells:
	if (cells.val) == (fileList.col[0]):
		out

return[/code]

My syntax is probably way off so feel free to correct me.

Thanks in advance.

Robbie

No scripting needed, sounds like a job for the merge DAT

Boom yes, that was much easier. 2 tables in to Merge DAT append columns and switch on By Name.

Thanks Achim