From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vicente Vera Subject: Re: Complex conversion of text to org table Date: Sun, 12 Mar 2017 15:26:21 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113b096c90fe9d054a8a375f Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cn5O5-0001Ij-HT for emacs-orgmode@gnu.org; Sun, 12 Mar 2017 11:26:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cn5O4-0003ZX-BP for emacs-orgmode@gnu.org; Sun, 12 Mar 2017 11:26:25 -0400 Received: from mail-oi0-x22a.google.com ([2607:f8b0:4003:c06::22a]:33081) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cn5O4-0003Y5-4G for emacs-orgmode@gnu.org; Sun, 12 Mar 2017 11:26:24 -0400 Received: by mail-oi0-x22a.google.com with SMTP id 2so68659181oif.0 for ; Sun, 12 Mar 2017 08:26:22 -0700 (PDT) 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: Xebar Saram Cc: org mode --001a113b096c90fe9d054a8a375f Content-Type: text/plain; charset=UTF-8 Hello. In this case Org splits into columns everytime it sees a space, so "baking soda" ends up in two columns. A brute force solution: replace the spaces between words that shouldn't be put into separated columns with an underscore: 1_cup all-purpose_flour Convert it to an Org table and then do a quick M-x replace-string to replace '_' with ' '. 2017-03-12 15:14 GMT+00:00 Xebar Saram : > 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 | | | | | > | | > | 2 | tablespoons | white | vinegar | (%or | better | yet | > lemon | juice%) | > | 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 | | | | | | > | | > > > 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 > --001a113b096c90fe9d054a8a375f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello= . In this case Org splits into columns everytime it sees a space, so "= baking soda" ends up in two columns. A brute force solution: replace t= he spaces between words that shouldn't be put into separated columns wi= th an underscore:

1_cup all-purpose_flour

Convert it to an Org table and then do a quick M-x replac= e-string to replace '_' with ' '.

2017-03-12 15:14 GMT= +00:00 Xebar Saram <zeltakc@gmail.com>:
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 wh= ite vinegar
1 cup all-purpose flour
2 tablespoons white sugar
1 t= easpoon baking powder
1/2 teaspoon baking soda
1/2 teaspoon salt
1= egg
2 tablespoons butter, melted
cooking spray

if i mark thi= s as a region and issue `org-table-create-or-convert-from-region` this= is the result

| =C2=A0 =C2=A0 3/4 | cup =C2=A0 =C2= =A0 =C2=A0 =C2=A0 | milk =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 = =C2=A0 | =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 |= =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
| =C2=A0 = =C2=A0 =C2=A0 2 | tablespoons | white =C2=A0 =C2=A0 =C2=A0 | vinegar | (%or= | better | yet | lemon | juice%) |
| =C2=A0 =C2=A0 =C2=A0 1 | cu= p =C2=A0 =C2=A0 =C2=A0 =C2=A0 | all-purpose | flour =C2=A0 | =C2=A0 =C2=A0 = =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 |= =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
| =C2=A0 =C2=A0 =C2=A0 2 | tablesp= oons | white =C2=A0 =C2=A0 =C2=A0 | sugar =C2=A0 | =C2=A0 =C2=A0 =C2=A0| = =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 | =C2=A0 = =C2=A0 =C2=A0 =C2=A0 |
| =C2=A0 =C2=A0 =C2=A0 1 | teaspoon =C2=A0= =C2=A0| baking =C2=A0 =C2=A0 =C2=A0| powder =C2=A0| =C2=A0 =C2=A0 =C2=A0| = =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 | =C2=A0 = =C2=A0 =C2=A0 =C2=A0 |
| =C2=A0 =C2=A0 1/2 | teaspoon =C2=A0 =C2= =A0| baking =C2=A0 =C2=A0 =C2=A0| soda =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0|= =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 | =C2=A0= =C2=A0 =C2=A0 =C2=A0 |
| =C2=A0 =C2=A0 1/2 | teaspoon =C2=A0 =C2= =A0| salt =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0= =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 | =C2=A0 =C2=A0 = =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
| =C2=A0 =C2=A0 =C2=A0 1 |= egg =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2= =A0 =C2=A0| =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2= =A0 |
| =C2=A0 =C2=A0 =C2=A0 2 | tablespoons | butter, =C2=A0 =C2= =A0 | melted =C2=A0| =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2= =A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
| cooking | spray =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2= =A0 =C2=A0 =C2=A0| =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2= =A0 =C2=A0 |


as you can see i= t 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 the= re a more intelligent way of auto directing the conversion to split it the = correct way?

if not any suggestions on how to conv= ert it in a better way? perhaps a command to quick delete the separator (|)= across all the column?

thx alot= in advance

Z

--001a113b096c90fe9d054a8a375f--