RembrandtWasAnegro · 2022-05-11 21:52
I copy a lot of text from browsers into org tables and the use of the '|' for cells is very awkward me. Does orgmode provide the means to use an alternative character?
If that is possible what rarely used characters in English primarily are suitable for the table cells character?
Can Unicode characters be used for that purpose, and what range can I look into?
T_Verron · 2022-05-12 07:13
I am not aware of any way to change the character used to represent columns in the text file, and in particular to input columns.
But for the specific purpose of converting text copied over, you can use `org-table-create-or-convert-from-region`, bound to `C-c |`. Just paste, select, and call the command. By default it tries to be smart about separators, you can force CSV with `C-u` and force tab-separated with `C-u C-u`.
Or you can call the underlying `org-table-convert` with an explicit separator (can even be a regexp).
It is however possible to change the way columns are displayed, see the package valign: https://github.com/casouri/valign
Phil-Hudson · 2022-05-12 13:42
When I have to store a URL containing a pipe character in an Org table, I use the URL-escaping code '%7C'. In the specific case I'm thinking of, I process those URLs before tangling/exporting them and I re-substitute '|' back in, but it should not matter: a well-behaved web server will do the translation automatically. So it should always be safe to use this approach.
Phil-Hudson · 2022-05-12 13:44
Here's the function I use, given the variable `url` contains the URL:
(s-replace "%7C" "|" url)
It's safe to use with URLs that don't include the pipe character too; it leaves them unchanged.
DedlyWombat · 2022-05-12 14:12
This may not help at all, but maybe a little, or maybe I'm only being annoying, but...
1) To display a table as plain text, the "EXAMPLE" blocks work:
From The Org Manual, 12.6 Literal Examples...
\#+BEGIN\_EXAMPLE
Some example from a text file.
\#+END\_EXAMPLE
2) A colon followed by one or more whitespace characters on a line comments out "commands", producing plain text that shows up on export formatted as an example block.
3) Use a zero-width (hidden) space character as the first one in a "command" to display it as deactivated plain text.
Insert via...
C-x 8 <RET> zero width space <RET>
or
C-x 8 <RET> 200B <RET>
For the last two items, I can't remember where the notes are in the Org manual, but they do work. (Sorry for the formatting but I can't figure out how to make this look normal.)
RembrandtWasAnegro · 2022-05-13 03:46
Thanks. This is a good idea.
I use a Firefox addon to copy trees of links, so I will see if I can modify the Javascript code to edit and replace them automatically.
Another good idea would be to use a separate command for pasting the clipboard contents where I paste to a buffer the search and replace is done before posting that buffer into the editor.