Include "MapBasic.def" Declare Sub Main Declare Sub ReadTextFileToArray(ByVal txtFilePath as String, myArray() as String) Sub Main() Dim myArray() as String '// create an array to store the table paths Dim tabName, tabPath, txtFile as String Dim i as Integer '// test file txtFile = "List.txt" '// Open file to merge to Open Table "merged.tab" as merged '// create your list of paths text file... then: Call ReadTextFileToArray(txtFile, myArray) '// populate your array with the table paths from the text file For i = 1 to UBound(myArray) If right$(myArray(i), 3) = "TAB" then '// check that this is a tab file path tabPath = myArray(i) '// get path from array Open table tabPath '// open table tabName = TableInfo(0, TAB_INFO_NAME) '// Get Table name ' Alter table tabName(modify elev_text Char(4)) '// Perform function Insert Into merged ( COL1, COL2, COL3, COL4) Select COL1, COL2, COL3, COL4 From tabName DropIndex Auto ' Pack table tabName Graphic Data '// pack table End if Next '// go to next element in array Commit Table merged Interactive End Sub Sub ReadTextFileToArray(ByVal txtFilePath as String, myArray() as String) Dim i as Integer i = 1 Open file txtFilePath for input as #1 '// open text file for input (to read) as #1 Do Until EOF(1) '// do until the end of file #1 is reached Redim myArray(i) '// resize array to i Input #1, myArray(i) '// read value from text file i = i + 1 '// increment i Loop '// return to Do Until... End Sub