all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* convert outline to .csv
@ 2016-01-18  6:44 Andrew
  2016-01-18  7:21 ` briangpowell .
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew @ 2016-01-18  6:44 UTC (permalink / raw
  To: emacs-orgmode

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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: convert outline to .csv
  2016-01-18  6:44 convert outline to .csv Andrew
@ 2016-01-18  7:21 ` briangpowell .
  0 siblings, 0 replies; 2+ messages in thread
From: briangpowell . @ 2016-01-18  7:21 UTC (permalink / raw
  To: Andrew; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]

* 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 <heartsayer@gmail.com> 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?
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 1701 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-18  7:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-18  6:44 convert outline to .csv Andrew
2016-01-18  7:21 ` briangpowell .

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.