From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: Complex conversion of text to org table Date: Sun, 12 Mar 2017 17:51:19 +0100 Message-ID: <58C57C87.9050208@free.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cn6iJ-00055E-Bl for emacs-orgmode@gnu.org; Sun, 12 Mar 2017 12:51:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cn6iI-0002i3-LE for emacs-orgmode@gnu.org; Sun, 12 Mar 2017 12:51:23 -0400 Received: from smtp2-g21.free.fr ([2a01:e0c:1:1599::11]:53052) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cn6iI-0002g1-DZ for emacs-orgmode@gnu.org; Sun, 12 Mar 2017 12:51:22 -0400 Received: from [IPv6:2a01:e35:2e21:def0:99c9:69c8:1848:256f] (unknown [IPv6:2a01:e35:2e21:def0:99c9:69c8:1848:256f]) by smtp2-g21.free.fr (Postfix) with ESMTP id A5439200382 for ; Sun, 12 Mar 2017 17:51:19 +0100 (CET) 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" To: emacs-orgmode@gnu.org Use a regex replacement. Basically you replace the 1st space with a vertical pipe: M-x query-replace-regexp ^\([^ ]+\) |\1| answer yes repeatedly, then type TAB to align the table. Le 12/03/2017 16:14, Xebar Saram a =C3=A9crit : > Hi list > > so im trying to use orgmode to collect food recepies. i have one issue > which is to convert text based ingridents list into org tables. > > for example take this list > > 3/4 cup milk > 2 tablespoons white vinegar > 1 cup all-purpose flour > 2 tablespoons white sugar > 1 teaspoon baking powder > 1/2 teaspoon baking soda > 1/2 teaspoon salt > 1 egg > 2 tablespoons butter, melted > cooking spray > > if i mark this as a region and issue > `org-table-create-or-convert-from-region` this is the result > > | 3/4 | cup | milk | | | | =20 > | | | > | 2 | tablespoons | white | vinegar | (%or | better | yet > | lemon | juice%) | > | 1 | cup | all-purpose | flour | | | =20 > | | | > | 2 | tablespoons | white | sugar | | | =20 > | | | > | 1 | teaspoon | baking | powder | | | =20 > | | | > | 1/2 | teaspoon | baking | soda | | | =20 > | | | > | 1/2 | teaspoon | salt | | | | =20 > | | | > | 1 | egg | | | | | =20 > | | | > | 2 | tablespoons | butter, | melted | | | =20 > | | | > | cooking | spray | | | | | =20 > | | | > > > as you can see it got the amount (1/2) and the unit (cup) right yet > the actual ingredients is cut into several columns > > i dont really know how to deal with this. is there a more intelligent > way of auto directing the conversion to split it the correct way? > > if not any suggestions on how to convert it in a better way? perhaps a > command to quick delete the separator (|) across all the column? > > thx alot in advance > > Z