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

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

Re: exporting nested list to CSV file


From: Thorsten Jolitz
Subject: Re: exporting nested list to CSV file
Date: Tue, 22 Jul 2014 21:35:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Christopher Howard <cmhoward2@alaska.edu> writes:

> Hi. I've been using the pcsv library to parse data from external CSV
> files, then using various elisp functions to filter/munge the
> data. Afterwards, I was sad to discover that pcsv does not have any
> functions for /writing/ data back to a CSV file.
>
> Since the data is well-structured, presumably this shouldn't be hard
> to do. Could I get some guidance on what would be the simplest
> approach? Is there another library I've overlooked? Or some built-ins
> that would be especially helpful? The data are in lists like so:
>
> (("row0datastring", "row0datastring", "row0datastring", ...)
>  ("row1datastring", "row1datastring", "row1datastring", ...)
>  ...
> )

try something like:

#+begin_src emacs-lisp 
  (mapconcat
   'identity
   (append
    '("row0datastring" "row0datastring" "row0datastring")
    '("row1datastring" "row1datastring" "row1datastring")) ",")
#+end_src

#+results:
: 
row0datastring,row0datastring,row0datastring,row1datastring,row1datastring,row1datastring

-- 
cheers,
Thorsten




reply via email to

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