I have a script that is supposed to:
1) Allow the user to pick multiple files to open
2) Close any files that have no data (ie only one column with one value that says NA)
3) Close any files that do not contain 1146 in column 7 (the column is called Sealer # in some filesand is unnamed in others, further it is a character column in some files and a numeric column in others)
I have gotten the first two things working, but am struggling with the third. Here is the script that I have so far.
Files = Pick File(
"Select JMP File",
"$DESKTOP\Burst Data for Spencer",
{"Excel|csv;xlsx;xls", "JMP Files|jmp;jsl;jrn", "All Files|*"},
1,
0,
"",
"multiple"
);
For( i = 1, i <= N Items( Files ), i++,
DT = Try( Open( Files[i] ) );
DT << Set Name( Files[i] );
If( N Cols( DT ) == 1,
Close( DT, No Save ),
Column( 7 ) << Data Type( Character );
check = DT << Get Rows Where( Contains( Column( 7 ), "1146" ) );
If( N Rows( check ) == 0,
Close( DT, No Save )
);
);
);
To the best I can tell the problem is the the line check = DT<<Get Rows Where(Contains(column(7), "1146"));, but I can't figure out how to fix it.
Any suggestions?