Thanks Michael, but I don't think the number reference would be to
difficult, rather the contents after the number, which could include tabs
or spaces, as I illustrated...I just don't want to go through another loop
to get the note contents...
Here's what I have...(masi-get-reference) is stored in drawing, but could
be any file name.
(defun c:test (/ file ofile oline olist)
(setq file (masi-get-reference))
(if (findfile file)
(progn
(setq ofile (open file "r"))
(while (setq oline (read-line ofile))
(setq olist (cons oline olist)
nlist (cons (substr oline 1 5) nlist)
)
);end of while
(close ofile)
)
)
(list (reverse nlist)(reverse olist))
)
"Michael Puckett" <Sp@mYourself.Sucka> wrote in message
news:41c867cf$1_1@newsprd01...
What about using vl-string-trim, vl-string-search etc. to suit ...
(vl-string-trim " */t" "***122 LINE ONE")
=> "122 LINE ONE"
(if
(setq pos
(vl-string-search
" "
(setq temp
(vl-string-trim
" */t"
"**122 LINE ONE"
)
)
)
)
(substr temp 1 pos)
)
=> "122"
Etc.
"Rudy Tovar" <Rudy@CadentityNoSpam.com> wrote in message
news:41c861bd$1_3@newsprd01...
Before I actually get started, perhaps someone has already done this...
it's
actually a no brainer, but like to see if anyone has come up with a
condensed version that's a bit more efficient...
OK...
First a text a file that contains...
****THIS COMMENT OR THAT****
**122 LINE ONE
**123 LINE TWO
**124 LINE THREE
********************************
Considering it may contain spaces and more comments, I'd like to be able
to
use vl-position to located number "122" in a list that I'll be creating
of a
file reference.
Also, eliminate any spaces, or tabs when returning the reference number
"LINE ITEM NOTE".
list> = ("****THIS COMMENT OR THAT****" "" "**122 LINE ONE"
....etc.....)
In the end I'd like to say (get-note "123" <list>) and all it returns is
"LINE TWO" without any spaces or tabs in front of the note...
I'd like to eliminate possibilities that someone may use spaces, tabs or
both when writing the line item note.
I know I could come up with a simple solution, but I'd like to see if
someone may have a more efficient method, instead of having to compare
each
character in the LINE considering that the list could contain hundreds
or
items listed.
Thank you for your comments