0

I tried convert the following region to table

Attribute     Description
form          A dictionary with all the form fields submitted with the request.
args          A dictionary with all the arguments passed in the query string of the URL.
values        A dictionary that combines the values in form and args.
cookies       A dictionary with all the cookies included in the request.
headers       A dictionary with all the HTTP headers included in the request.
files         A dictionary with all the file uploads included with the request.
get_data()    Returns the buffered data from the request body.
get_json()    Returns a Python dictionary with the parsed JSON included in the body of the request.
blueprint     The name of the Flask blueprint that is handling the request. Blueprints are introduced in Chapter 7.
endpoint      The name of the Flask endpoint that is handling the request. Flask uses the name of the view function as the endpoint name for a route.
method        The HTTP request method, such as GET or POST.
scheme        The URL scheme (http or https).
is_secure()   Returns True if the request came through a secure (HTTPS) connection.
host          The host defined in the request, including the port number if given by the client.
path          The path portion of the URL.
query_string  The query string portion of the URL, as a raw binary value.
full_path     The path and query string portions of the URL.
url           The complete URL requested by the client.
base_url      Same as url, but without the query string component.
remote_addr   The IP address of the client.
environ       The raw WSGI environment dictionary for the request.

Tried multiple times to convert the region to table but failed.

Could please provide any hints?

2

From the documentation:

‘C-c | (org-table-create-or-convert-from-region)’

 Convert the active region to a table.  If every line contains at
 least one TAB character, the function assumes that the material is
 tab separated.  If every line contains a comma, comma-separated
 values (CSV) are assumed.  If not, lines are split at whitespace
 into fields.  You can use a prefix argument to force a specific
 separator: ‘C-u’ forces CSV, ‘C-u C-u’ forces TAB, ‘C-u C-u C-u’
 will prompt for a regular expression to match the separator, and a
 numeric argument N indicates that at least N consecutive spaces, or
 alternatively a TAB will be the separator.

So you first need to set the region to contain the block of test (C-SPACE at begin of first line, then move point at end of last line) and then you can do the following:

C-u 2 C-c |

That is, specify that the columns are separated by at least two consecutive spaces (or a TAB).

For more complex separators, one can use a regular expression to specify column separators (here the regexp specifies a sequence of at least two spaces):

C-u C-u C-u C-c| [[:blank:]][[:blank:]]+ RET

This command itself calls command org-table-convert-region which is available from the Tbl menu in the menu bar (*1).


(*1) However, to provide arguments, you have to proceed as for the two examples above, replacingC-c | by a click on this menu entry, so the menu entry is usefull only for the case where the command is able to discover the column separators (TAB, comma, or whitespace).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.