all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Robert Thorpe" <rthorpe@realworldtech.com>
Subject: Re: File I/O
Date: 2 Nov 2006 10:19:05 -0800	[thread overview]
Message-ID: <1162491544.994880.84590@e3g2000cwe.googlegroups.com> (raw)
In-Reply-To: <slrnekk718.66k.tim@linus.johnson.com>

Tim Johnson wrote:
> On 2006-11-02, Robert Thorpe <rthorpe@realworldtech.com> wrote:
> >> IOWS: read a file
> >>       process stream a line at a time
> >> 	  process programmatically
> >
> > Not really.  The normal way of doing the above is to create a buffer
> > for the file first.
> >
> > It might be better if you tell us what you're trying to do, that makes
> > it easier to suggest something.
>
>  My hope was to read a file into an emacs data structure.
>  text delimited by an arbitrary line ( blank or all hyphens as an
>  example)
>
>  the data structure would be a list of lists.
>
>  each internal list would have 3 elements.
>
>  the first two would be strings, the last a list of strings.
>  and the structure would be accessed via 'assoc.
>
>  ( ;; begin parent structure
>   ( ;; begin element
>    "chop"  ;; key
>    "Remove last member" ;; terse description
>    ("Line one" "Line two" "Line three") ;; verbose description
>    )
>  )
>

You could use the command David mentions below for this.

If you are defining the data file yourself there is no reason not to
use elisp read and print.
In elisp a set of lists can be printed by "print" and reconstructed by
reading with "read".

>  I've created such a structure using a General Purpose Programming
>  Language, but had headaches with escaping. Thought using emacs
>  might bypass that problem.

Escaping problems tend to be, erm, hard to escape.  Using elisp may not
help here.

  reply	other threads:[~2006-11-02 18:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-02  2:54 File I/O Tim Johnson
2006-11-02 12:53 ` Robert Thorpe
2006-11-02 16:54   ` Tim Johnson
2006-11-02 18:19     ` Robert Thorpe [this message]
2006-11-02 13:00 ` David Kastrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1162491544.994880.84590@e3g2000cwe.googlegroups.com \
    --to=rthorpe@realworldtech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.