I have annotated the script below with the issues I found. I am surprised you can read in a .dx file. JMP certainly does not support the writing out of .dx files(as far as I know).
Files = Pick File(
"Select File(s)",
"G:\Retention Compliant\Research\Analytical\Projects\IR database",
{"All Files|*"},
1,
0,
"",
"multiple"
);
For( i = 1, i <= N Items( Files ), i++,
// Open one file
Try( dt = Open( Files[i], "text" ) );
Wait( 0 );
// Loop from 1 to the number of files (even though only 1 file has been opened)
For( n = 1, n <= N Items( Files ), n++,
// Here you will be reading the column names in for the first file over and over
colList = dt << get column names( character, string );
// Loop using "i" as the index across all of the columns....in the first file
// since that is all we have read in.....but since you are using "i", you will
// be creating an infinate loop, since you are using "i" for the first loop
// and you will be interferring with the assumed stepping for the outter loop
For( i = 1, i <= N Items( colList ), i++,
selRows = dt << get rows where(
// You are not in a formula, so the Row() function will not provide a predictable result
Column( dt, colList[i] )[Row()] == "##YUNITS= % Transmittance" | Column( dt, colList[i] )[Row()] ==
"##YUNITS= % T"
);
If( N Rows( selRows ) > 0,
Column( dt, colList[i] )[selRows] = "##YUNITS= % T"
);
);
);
);
Jim