cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
BladeRunner
Level II

Deleting a row based on the presence of specific words in a cell

Hello All!  I think this might be a common situation for many working with data files from various instruments. My data sets are derived from stitching multiple output files from a specific instrument.  Besides the useful data rows, there are a number of rows on top of each output file that specify the Recipe, File, and others, typically, this info is in Column 1.  For processing the data, I do not need that info, so I want to delete the unnecessary rows containing the above words Recipe, File, etc. in the cells in Column 1.  Note that there might be other words in the same cells, for example: "Wafer Recipe Name", or "Stage Group File", etc.  I tried a number of permutations on the following, but I always get an error message saying: "Send expects scriptable objects in access of evaluation of "Send", etc.  Many thanks in advance!

 

dt_new2 << get rows where (contains (:Column 1, "Recipe"));
dt_new2 << delete rows;
Wait(1);

 

dt_new2 << get rows where (contains (:Column 1, "File"));
dt_new2 << delete rows;
Wait(1)

1 REPLY 1
txnelson
Super User

Re: Deleting a row based on the presence of specific words in a cell

Try this

Names Default To Here( 1 );
dt_new2 = Current Data Table();
dt_new2 << select where( Contains( :Column 1, "Recipe" ) );
dt_new2 << delete rows;
Wait( 0 );

dt_new2 << select where( Contains( :Column 1, "File" ) );
dt_new2 << delete rows;

The Scripting Index

     Help=>Scripting Index

is a great source of statement syntax and examples.

Also, I advise you to take the time to read through the Scripting Guide found in the JMP Help

 

Jim