From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Swami Tota Ram Shankar Newsgroups: gmane.emacs.help Subject: string to list or string to array Date: Sun, 21 Oct 2012 03:37:08 -0700 (PDT) Message-ID: <62642868-f757-4115-a047-34c319a1c30f@o5g2000yqi.googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1350816014 2762 80.91.229.3 (21 Oct 2012 10:40:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Oct 2012 10:40:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 21 12:40:22 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TPsxA-0006nz-DF for geh-help-gnu-emacs@m.gmane.org; Sun, 21 Oct 2012 12:40:20 +0200 Original-Received: from localhost ([::1]:58037 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPsx3-0005rn-07 for geh-help-gnu-emacs@m.gmane.org; Sun, 21 Oct 2012 06:40:13 -0400 Original-Received: by 10.224.186.20 with SMTP id cq20mr3887705qab.8.1350815828091; Sun, 21 Oct 2012 03:37:08 -0700 (PDT) Original-Received: by 10.236.79.7 with SMTP id h7mr528944yhe.2.1350815828068; Sun, 21 Oct 2012 03:37:08 -0700 (PDT) Original-Path: usenet.stanford.edu!x14no3075142qar.0!news-out.google.com!r17ni43198318qap.0!nntp.google.com!x14no3075137qar.0!postnews.google.com!o5g2000yqi.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Complaints-To: groups-abuse@google.com Injection-Info: o5g2000yqi.googlegroups.com; posting-host=99.122.159.192; posting-account=dlefMQoAAABzowG6c0cULB8igkwPchCd Original-NNTP-Posting-Host: 99.122.159.192 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0,gzip(gfe) Injection-Date: Sun, 21 Oct 2012 10:37:08 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:195016 comp.emacs:102638 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87345 Archived-At: Friends, I am trying to read text from a file opened in emacs and recognize it as array or list so that I can do some vector additions using mapcar. I am mainly stuck at the stage of converting the string text to array or list. The method which I use to locate the text is "looking-at" function and the regexp works. (when (looking-at "[[0-9.+-\\ ]+]") some code that is to play around for debugging and messaging and checking the match (forward-char (+ (string-width (match-string 0)) 1)) (setq V (match-string 0)) (setq V (intern (match-string 0))) The cursor is placed on the start bracket, ie "[" and text looks like for example array of indefinite length [17.16 -17.16 17.16 17.16 17.16 17.16 17.16 17.16] Please suggest some different solutions that can take the string matched, match-string for example and convert to a list or an array on which I can do mapcars or lambdas. Thanks Swami