Jump to content

How to strip values as text at a text list


devitg

Recommended Posts

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 

 

Link to comment
Share on other sites

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
_$ 

 

Link to comment
Share on other sites

This ?

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

 

  • Agree 1
Link to comment
Share on other sites

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. 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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