cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

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

remove few items from a list using script

hi, everyone

I have a list like below and I wrote this script trying to remove items from a list using script which start with ".", but it reports error :"subscript range in access or evaluation of 'subscript', CSV_File_list[i]

=N Items(CSV_File_list);

(NOF);

(CSV_File_list);

(i=1,i<=NOF,i++,

(Starts With(CSV_File_list[i], "."),

Remove From(CSV_File_list, i),

);

CSV_File_list = {"FAB8_gf_MPW14011MA.A0_8XYL45155.049_A6-SRTOTPROM-14LPE.01_OTPROMMPW1401-SORT_04_BBOCN023SAG0_20150319-155848.csv", ".FAB8_gf_MPW14011MA.A0_8XYL45155.049_A6-SRTOTPROM-14LPE.01_OTPROMMPW1401-SORT_20150319-155445_04_BBOCN023SAG0_20150319-155848_20150319-171700.csv", "FAB8_gf_MPW14011MA.A0_8XYL45155.049_A6-SRTOTPROM-14LPE.01_OTPROMMPW1401-SORT_11_BBOCN016SAG7_20150319-171703.csv", ".FAB8_gf_MPW14011MA.A0_8XYL45155.049_A6-SRTOTPROM-14LPE.01_OTPROMMPW1401-SORT_20150319-155445_11_BBOCN016SAG7_20150319-171703_20150319-183919.csv"};


1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

Re: remove few items from a list using script

As items are removed from the the list they get fewer than "NOF" and eventually i will exceed the current number of list items.

To avoid this, remove from the end:

For(i = NOF, i > 0, i--, ...)

View solution in original post

1 REPLY 1
ms
Super User (Alumni) ms
Super User (Alumni)

Re: remove few items from a list using script

As items are removed from the the list they get fewer than "NOF" and eventually i will exceed the current number of list items.

To avoid this, remove from the end:

For(i = NOF, i > 0, i--, ...)

Recommended Articles