From mboxrd@z Thu Jan 1 00:00:00 1970 From: "briangpowell ." Subject: Re: convert outline to .csv Date: Mon, 18 Jan 2016 02:21:49 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e01493abe3c4aaa0529969bc5 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aL48N-0001Ih-Ct for emacs-orgmode@gnu.org; Mon, 18 Jan 2016 02:21:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aL48M-0000o9-JH for emacs-orgmode@gnu.org; Mon, 18 Jan 2016 02:21:51 -0500 Received: from mail-ob0-x234.google.com ([2607:f8b0:4003:c01::234]:33450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aL48M-0000o3-CT for emacs-orgmode@gnu.org; Mon, 18 Jan 2016 02:21:50 -0500 Received: by mail-ob0-x234.google.com with SMTP id is5so155560043obc.0 for ; Sun, 17 Jan 2016 23:21:50 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Andrew Cc: emacs-orgmode --089e01493abe3c4aaa0529969bc5 Content-Type: text/plain; charset=UTF-8 * Something like this might do it: tr "\n" "\",\"" < file > newfile sed -e "s/\",\"* /\n\",\"*/g" newfile > blah.csv On Mon, Jan 18, 2016 at 1:44 AM, Andrew wrote: > Example: > > * Micro topic 1 > ** Microbes are small > ** You can't see them! > *** Isn't that something? > * Micro topic 2 > ** I hope I like the teacher > *** She will be great! > ** Micro is cool! > > I'd like to convert them into a .csv file like so: > > "* Micro topic 1"," "** Microbes are small", "** You can't see them!", "*** > Isn't that something?", > "* Micro topic 2", "** I hope I like the teacher", "*** She will be > great!", > "** Micro is cool!" > > Where the first column contains only top level headings (lines beginning > with > one star), and the following columns are subheadings belonging to the top > level heading. So for each top level heading, there is one row containing > the top level heading and its children. I've been messing around with a > solution in python with regular expressions as well as macros but haven't > gotten very far. Any suggestions? > > > > --089e01493abe3c4aaa0529969bc5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
* Something like this might do it:

tr "\n" "\",\"" < file > newfile
=
sed -e "s/\",\"* /\n\",\"*/g"= =C2=A0newfile > blah.csv

On Mon, Jan 18, 2016 at 1:44 AM, Andrew <heartsay= er@gmail.com> wrote:
Exampl= e:

* Micro topic 1
** Microbes are small
** You can't see them!
*** Isn't that something?
* Micro topic 2
** I hope I like the teacher
*** She will be great!
** Micro is cool!

I'd like to convert them into a .csv file like so:

"* Micro topic 1"," "** Microbes are small", "= ;** You can't see them!", "***
Isn't that something?",
"* Micro topic 2", "** I hope I like the teacher", &quo= t;*** She will be great!",
"** Micro is cool!"

Where the first column contains only top level headings (lines beginning wi= th
one star), and the following columns are subheadings belonging to the top level heading.=C2=A0 So for each top level heading, there is one row contai= ning
the top level heading and its children.=C2=A0 I've been messing around = with a
solution in python with regular expressions as well as macros but haven'= ;t
gotten very far.=C2=A0 Any suggestions?




--089e01493abe3c4aaa0529969bc5--