help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using append to create a list from a line of text


From: acomber
Subject: Using append to create a list from a line of text
Date: Tue, 16 Apr 2013 02:58:14 -0700 (PDT)

I want to create a list of words from a line of text delimitted by tabs. I
want to basically split the line into atoms, split by tab.

The code below is sort of pseudocode but is this the best approach to do
this type of thing?

Here is my first attempt:-

(defun get-hdr()
    ;obviously point must be positioned on correct line
    (let (mylist)
      while(not (end-of-line)
         while(re-search-forward ("[A-Za-z]+[^\t\n]" nil t)
           append (match-string 1) mylist      
         )
      )
   )
)

How do I get my function to return the list, mylist?




--
View this message in context: 
http://emacs.1067599.n5.nabble.com/Using-append-to-create-a-list-from-a-line-of-text-tp283808.html
Sent from the Emacs - Help mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]