From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Subject: convert outline to .csv Date: Mon, 18 Jan 2016 06:44:03 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aL3dh-0004zO-Sw for emacs-orgmode@gnu.org; Mon, 18 Jan 2016 01:50:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aL3de-0001nG-LX for emacs-orgmode@gnu.org; Mon, 18 Jan 2016 01:50:09 -0500 Received: from plane.gmane.org ([80.91.229.3]:60492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aL3de-0001nB-Do for emacs-orgmode@gnu.org; Mon, 18 Jan 2016 01:50:06 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aL3dc-000357-Sa for emacs-orgmode@gnu.org; Mon, 18 Jan 2016 07:50:05 +0100 Received: from 24-121-121-174.flagcmtk01.res.dyn.suddenlink.net ([24-121-121-174.flagcmtk01.res.dyn.suddenlink.net]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jan 2016 07:50:04 +0100 Received: from heartsayer by 24-121-121-174.flagcmtk01.res.dyn.suddenlink.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jan 2016 07:50:04 +0100 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: emacs-orgmode@gnu.org 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?