From mboxrd@z Thu Jan 1 00:00:00 1970 From: anhnmncb Subject: Re: How to convert org file to such a plain text Date: Wed, 06 Aug 2008 00:19:14 +0800 Message-ID: <86k5evjuyl.fsf@fbsd.hasee.cpu> References: <87od4m4yvn.fsf@gentoo.hasee.cpu> <67E01FA0-85A3-40C6-932F-BEA625557DFF@uva.nl> <8663qtu7g3.fsf@freebsd.hasee.cpu> <2f1c7d020807260843h1563dcc4h918338aefce0f542@mail.gmail.com> <87ej5gtwnx.fsf@gentoo.hasee.cpu> <5CAE3D36-6412-4A93-B58E-A5AEB4C78D2C@uva.nl> <86k5f4ufio.fsf@freebsd.hasee.cpu> <86k5ewvfw6.fsf@freebsd.hasee.cpu> <2f1c7d020808050428n16516ba4wac2eea140f7e5c38@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KQPGe-0000h5-10 for emacs-orgmode@gnu.org; Tue, 05 Aug 2008 12:20:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KQPGc-0000cb-Ax for emacs-orgmode@gnu.org; Tue, 05 Aug 2008 12:20:11 -0400 Received: from [199.232.76.173] (port=45899 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQPGb-0000c3-Nx for emacs-orgmode@gnu.org; Tue, 05 Aug 2008 12:20:09 -0400 Received: from main.gmane.org ([80.91.229.2]:50986 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KQPGa-0000Wh-Ft for emacs-orgmode@gnu.org; Tue, 05 Aug 2008 12:20:09 -0400 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1KQPGU-0008ID-Qv for emacs-orgmode@gnu.org; Tue, 05 Aug 2008 16:20:03 +0000 Received: from 116.253.9.142 ([116.253.9.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Aug 2008 16:20:02 +0000 Received: from anhnmncb by 116.253.9.142 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Aug 2008 16:20:02 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org "Hugo Schmitt" writes: > anhnmncb, this helps you? > > (defun org-to-anhnmncb () > (interactive) > (goto-char (point-min)) > (let ((curlevel 0)) > (while (< (point) (point-max)) > (goto-char (point-at-bol)) > (cond > ((looking-at "\\(\\*+\\)\\s-*") > (setq curlevel (1- (length (match-string 1)))) > (replace-match (make-string curlevel ?\t))) > ((looking-at "\\s-*") > (replace-match (concat (make-string curlevel ?\t) "- ")))) > (forward-line 1)))) > > my test was this: > > * level1 > item > ** level2 > item > item > *** level3 > item > item > ** level2 again > item > item > > which gets converted into: > > level1 > - item > level2 > - item > - item > level3 > - item > - item > level2 again > - item > - item > > hope this helps, > hugo Really great, it helps me a lot! Thank you! > > On Mon, Aug 4, 2008 at 10:43 PM, Eddward DeVilla wrote: > > I don't know if you use perl at all. My first guess is: > > perl -pe's/^(\*+)(\s+.*)$/("\t"x length$1).$2/e' < TODO.org > TODO.txt > > Having tried it on a live file, I don't think the results are very > pleasing Replacing a single character '*' with a tab creates a > formatting mess with any other text in the file. > > Edd > > On Mon, Aug 4, 2008 at 12:39 PM, anhnmncb wrote: > > anhnmncb writes: > > > >> Carsten Dominik writes: > >> > >>> On Jul 26, 2008, at 9:52 AM, anhnmncb wrote: > >>> > >>>> "Hugo Schmitt" writes: > >>>> > >>>>> What are the odds that Carsten has plans to export to a format > >>>>> *you* just invented? > >>>> Oh, my pda app projekt can import this format of file, but if all of > >>>> you > >>>> think it's no use, nervermind. > >>> > >>> Hey, why the huff? > >>> > >>> The point is, you have not given us any chance at all to > >>> think it might be of any use! > >>> > >>> - Carsten > >>> > >> Sorry for delay, I can't reach the app website[1] right now, when it > >> can, I will provide the relavent information. > >> > >> [1] http://www.kylom.com/ > > > > Sorry, I can't find more useful info, the app just says it can import > > the txt file which has different level of indents. So I think replace > > star(*) with is enough. Such like this: > > > > Org file --> txt file > > -------------------- -------------------- > > |* level 1 |level 1 > > |** level 2 --> |level 2 > > |- item |- item > > |*** level 3 |level 3 > > -------------------- -------------------- > > > > I'm not a programmer, so if my request is stupid and easy to achieve by > > any other way, please let me know. > > > >> > >>>> > >>>>> > >>>>> On Fri, Jul 25, 2008 at 3:47 PM, anhnmncb wrote: > >>>>> > >>>>> Carsten Dominik writes: > >>>>> > >>>>>> We do not have an exporter that can do this right now. > >>>>>> > >>>>>> - Carsten > >>>>> Will it come in furture? > >>>>>> > >>>>>> On Jul 24, 2008, at 4:59 PM, anhnmncb wrote: > >>>>>> > >>>>>> I want to export org to plan text, which pattern is: > >>>>>> -------------------- > >>>>>> |level 1 > >>>>>> |level 2 > >>>>>> |- item > >>>>>> |level 3 > >>>>>> -------------------- > >>>>>> instead of > >>>>>> -------------------- > >>>>>> |* level 1 > >>>>>> |** level 2 > >>>>>> |- item > >>>>>> |*** level 3 > >>>>>> -------------------- > >>>>>> -- > >>>>>> Regards, > >>>>>> > >>>>>> anhnmncb > >>>>>> gpg key: 44A31344 > >>>>>> > >>>>>> _______________________________________________ > >>>>>> Emacs-orgmode mailing list > >>>>>> Remember: use `Reply All' to send replies to the list. > >>>>>> Emacs-orgmode@gnu.org > >>>>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > >>>>>> > >>>>>> _______________________________________________ > >>>>>> Emacs-orgmode mailing list > >>>>>> Remember: use `Reply All' to send replies to the list. > >>>>>> Emacs-orgmode@gnu.org > >>>>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > >>>>> > >>>>> -- > >>>>> Regards, > >>>>> > >>>>> anhnmncb > >>>>> gpg key: 44A31344 > >>>>> > >>>>> _______________________________________________ > >>>>> Emacs-orgmode mailing list > >>>>> Remember: use `Reply All' to send replies to the list. > >>>>> Emacs-orgmode@gnu.org > >>>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > >>>>> > >>>>> _______________________________________________ > >>>>> Emacs-orgmode mailing list > >>>>> Remember: use `Reply All' to send replies to the list. > >>>>> Emacs-orgmode@gnu.org > >>>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > >>>> > >>>> -- > >>>> Regards, > >>>> > >>>> anhnmncb > >>>> gpg key: 44A31344 > >>>> > >>>> > >>>> > >>>> _______________________________________________ > >>>> Emacs-orgmode mailing list > >>>> Remember: use `Reply All' to send replies to the list. > >>>> Emacs-orgmode@gnu.org > >>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > >>> > >>> > >>> > >>> _______________________________________________ > >>> Emacs-orgmode mailing list > >>> Remember: use `Reply All' to send replies to the list. > >>> Emacs-orgmode@gnu.org > >>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > >>> > > > > -- > > Regards, > > > > anhnmncb > > gpg key: 44A31344 > > > > > > > > _______________________________________________ > > Emacs-orgmode mailing list > > Remember: use `Reply All' to send replies to the list. > > Emacs-orgmode@gnu.org > > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode -- Regards, anhnmncb gpg key: 44A31344