cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
woongkim79
Level II

How to find and delete rows in a data table containing a text (or elements in a list)

I have a list containing a combinations of letters ... e.g A B C D...

Column1

A

B

C

D

AB

AC

AD

ABC

ABD

..... so forth or as a list e.g. mylist = {A, B, C, D, AB, AC, AD, ABC, ABD....}.

While it is possible to find those cells starting with "AB" using Edit-Search-Find from the table menu, it is strange I cannot find a way to do this using JSL script.

I would imagine something like:

loc (mylist,"AB?") for a list or

current data table << get rows where (Column 1 == "AB?") for a data table

...should work but they don't.

Can anyone suggest a way to locate these values using a wildcard (i.e. AB?) or other clever ways to find these items and delete them?

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: How to find and delete rows in a data table containing a text (or elements in a list)

This is a perfect situation for using regular expressions.  For a table you can use the REGEX function:

dt = open("$sample_data/Car Physical Data.jmp");

ch_rows = dt << get rows where(regex(:Model, "^Ch") == "Ch");

That code snippet will find all rows beginning with the string "Ch".

View solution in original post

2 REPLIES 2
pmroz
Super User

Re: How to find and delete rows in a data table containing a text (or elements in a list)

This is a perfect situation for using regular expressions.  For a table you can use the REGEX function:

dt = open("$sample_data/Car Physical Data.jmp");

ch_rows = dt << get rows where(regex(:Model, "^Ch") == "Ch");

That code snippet will find all rows beginning with the string "Ch".

woongkim79
Level II

Re: How to find and delete rows in a data table containing a text (or elements in a list)

Beautiful!  Thank you so much PMroz.

Recommended Articles