Jump to content

Recommended Posts

Posted

Hi,

I am placing numbers in cad 2004,here i required tool to find out the list of missing number in between those in a .csv or .txt.

 

1)Example : if 1,2,3,5,68,99

 

Missing list,

4

6-67

69-98

 

2)Example : if 350,351,352,355,386

353-354

356-385

 

 

Thank u,

VVV

Posted

Use an incrementing variable in conjunction with the member function to check the variable against a list of numbers, e.g.:

 

(defun missingnumbers ( l / i m r )
   (setq i (apply 'max l)
         m (apply 'min l)
   )
   (while (< m (setq i (1- i)))
       (if (not (member i l)) (setq r (cons i r)))
   )
   r
)

_$ (missingnumbers '(1 2 3 5 68 99))
(4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98)

_$ (missingnumbers '(350 351 352 355 386))
(353 354 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385)

  • 3 years later...
Posted
Use an incrementing variable in conjunction with the member function to check the variable against a list of numbers, e.g.:

 

(defun missingnumbers ( l / i m r )
   (setq i (apply 'max l)
         m (apply 'min l)
   )
   (while (< m (setq i (1- i)))
       (if (not (member i l)) (setq r (cons i r)))
   )
   r
)

_$ (missingnumbers '(1 2 3 5 68 99))
(4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98)

_$ (missingnumbers '(350 351 352 355 386))
(353 354 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385)

 

 

Hi,

I have query regarding number missing in Dwg file.

I am working with parcel mapping, Here we are placing parcel number.

 

I am getting one or two parcel no. is missing.

 

i.e. if i placed 1 to 1000 parcel text. i want a tool how many parcel text (Number) is missing in between in dwg.

 

can show the missing number in text file.

 

Kindly send me the tool or code

Posted

(defun c:tt()

(setq k 0 newlist nil g 1)

(repeat (length mylist)

(if (/= (setq listmember(nth k mylist)) g )

(setq newlist(cons listmember newlist))

)

(setq k(1+ k)g(1+ g))

)

)

  • 4 weeks later...
Posted

Hi,

i don't know how will run this code. I am new to coding.

 

kindly any body suggest me for this tool.

 

"Text are in TEXT_PARCEL" layer. I have placed serial parcel text, but between these series text one or two numbers are missing. i want to get tool for find out these missing numbers in list." kindly anybody do the needful.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...