Jump to content

Recommended Posts

Posted

Please , I need to strip and discard  all text that only represent a value , and keep text despite it have some value in. 

From this list 

(setq text+value-list(list "SUBRASANTE"
   "C.T.N."	"SUB-BASE"   "0.00"	  "CORTE CAJA 2"
   "CAJA 100%"	"0.01"	     "0.02"	  "0.03"       "16.59"
   "17.86"	"18.41"	     "2025.81"	  "31421.14"   "22.04"
   "22.39"	"33.62"
  ))

 To this one 

(setq no-value-list
       (list
	 "SUBRASANTE" "C.T.N." "SUB-BASE" "CORTE CAJA 2" "CAJA 100%") ;_ end of list
)

Thanks in advance 

 

Posted
4 minutes ago, mhupp said:

iterate through the lisp  with numberp

  @mhupp  as I state it are nor real value it are string 

 

_$ (numberp  "18.41")
nil
_$ 

 

Posted

@mhupp Neither I can use ATOF or ATOI 

(atof "C.C.C. 95%")
0.0

As it return a number for a string 

 

Posted

This ?

(vl-remove nil (mapcar '(lambda (x) (if (eq (type (read x)) 'SYM) x)) text+value-list))

 

  • Agree 1
Posted
3 minutes ago, Tsuky said:

This ?

(vl-remove nil (mapcar '(lambda (x) (if (eq (type (read x)) 'SYM) x)) text+value-list))

 

Thanks , really a good solution. 

 

Posted

Even simpler:

(vl-remove-if 'distof lst)

 

  • Like 1
  • Agree 2
Posted
2 hours ago, devitg said:

  @mhupp  as I state it are nor real value it are string 

 

_$ (numberp  "18.41")
nil
_$ 

 

Been working in Vba to long isnumber() works on strings as well

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...