write selected rows to a new file<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />I have a script where I select rows from a table based on certain criteria:
dt << Select Where( :gender == "female" & :dx == "ild" );
How can I write these "selected rows" to a new file?
Thanks
Re: write selected rows to a new fileawalts12,
You can make the table invisible by doing the following and wrap it in a for loop to do all subsetting in one step.
dt << Select Where( :gender == "female" & :dx == "ild" );
dt << Clear Column Selection();
sub=dt<), Selected Rows(1), Invisible);
Re: write selected rows to a new filedt << select whee (substr(:name,1,1)=="A");
dt2 = dt << subset(invisible,selected columns(0), selected rows(1));
This will make the data table invisible to the user, however, it will still appear in the JMP Windows List. You can substitute "Private" for "Invisible" and the new data table will be invisible to the user and the JMP Windows List.
Make sure you close the data tables when you are done with them,
close(dt2, nosave);
Jim
Re: write selected rows to a new fileBack to the subset command, is there a way to suppress JMP from opening a new window with the subset of data?
I'm extracting 10 different subsets and then concatenating them together. So I need to generate each subset, but I don't need to see the subsets (except for debugging purposes) until they are concatenated. I have the concatenation coded fine, but every time i run my script I have to close the 10 "subset windows".
Thanks again
Avram
Re: write selected rows to a new filedt << Select Where(substr(:name,1,1) == "A");
Re: write selected rows to a new fileThanks for the help - this works nicely.
One other question as I am new to JMP's syntax. How can I include a wild card in the "select Where" command.
For example
dt << Select Where( :name == "A*")
doesn't seem to work - I'd like to be able to select all names starting with an A.
Thanks again.
Re: write selected rows to a new fileThe first column may have been selected. Try this to override any column selection:
sub = dt << Subset(output table name("my_sub"), Selected Rows(1), Selected Columns(0));
Re: write selected rows to a new fileawalts12,
Sounds like you have column A selected. In that case JMP will subset the selected column and selected rows.
dt << Select Where( :gender == "female" & :dx == "ild" );
dt << Clear Column Selection();
sub=dt<), Selected Rows(1));
Re: write selected rows to a new fileThis looks good ...
But it outputs only the first column (call it Column A) in each row. Is there a way to write the entire row (Columns A - Column R).
Thanks again
Re: write selected rows to a new fileAwalts12,
You should be able to do the following:
dt << Select Where( :gender == "female" & :dx == "ild" );
sub=dt<), Selected Rows(1));
Dave