Text substitution only in specific column of org table
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I came across this problem today: I had a table with many entries and wanted to perform a text substitution (normal text substitution was sufficient as I hardly ever need regex text substitutions) in all cells of a single column. I ended up pressing y
and n
many times, instead of just !
as it would've been had I had a way of restricting the text substitution (I used M-%
/ query-replace
).
What's the best way of performing this task?
org-mode org-table query-replace table
add a comment |Â
up vote
3
down vote
favorite
I came across this problem today: I had a table with many entries and wanted to perform a text substitution (normal text substitution was sufficient as I hardly ever need regex text substitutions) in all cells of a single column. I ended up pressing y
and n
many times, instead of just !
as it would've been had I had a way of restricting the text substitution (I used M-%
/ query-replace
).
What's the best way of performing this task?
org-mode org-table query-replace table
Seeregion-extract-function
which is respected byquery-replace
. The tricky part is to get the buffer-positions of the table slice's rows.
â politza
4 hours ago
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I came across this problem today: I had a table with many entries and wanted to perform a text substitution (normal text substitution was sufficient as I hardly ever need regex text substitutions) in all cells of a single column. I ended up pressing y
and n
many times, instead of just !
as it would've been had I had a way of restricting the text substitution (I used M-%
/ query-replace
).
What's the best way of performing this task?
org-mode org-table query-replace table
I came across this problem today: I had a table with many entries and wanted to perform a text substitution (normal text substitution was sufficient as I hardly ever need regex text substitutions) in all cells of a single column. I ended up pressing y
and n
many times, instead of just !
as it would've been had I had a way of restricting the text substitution (I used M-%
/ query-replace
).
What's the best way of performing this task?
org-mode org-table query-replace table
org-mode org-table query-replace table
asked 5 hours ago
UTF-8
342115
342115
Seeregion-extract-function
which is respected byquery-replace
. The tricky part is to get the buffer-positions of the table slice's rows.
â politza
4 hours ago
add a comment |Â
Seeregion-extract-function
which is respected byquery-replace
. The tricky part is to get the buffer-positions of the table slice's rows.
â politza
4 hours ago
See
region-extract-function
which is respected by query-replace
. The tricky part is to get the buffer-positions of the table slice's rows.â politza
4 hours ago
See
region-extract-function
which is respected by query-replace
. The tricky part is to get the buffer-positions of the table slice's rows.â politza
4 hours ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
You can transpose the table with org-table-transpose-table-at-point
, then select the relevant row (which used to be a column).
Narrow to region, replace-string, widen, and transpose again.
Note that you may lose hlines when transposing.
add a comment |Â
up vote
1
down vote
You can select the column as a rectangular region using C-x SPC
(rectangle-mark-mode
) and then M-%
(query-replace
) will be
limited to that rectangle.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
You can transpose the table with org-table-transpose-table-at-point
, then select the relevant row (which used to be a column).
Narrow to region, replace-string, widen, and transpose again.
Note that you may lose hlines when transposing.
add a comment |Â
up vote
1
down vote
You can transpose the table with org-table-transpose-table-at-point
, then select the relevant row (which used to be a column).
Narrow to region, replace-string, widen, and transpose again.
Note that you may lose hlines when transposing.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
You can transpose the table with org-table-transpose-table-at-point
, then select the relevant row (which used to be a column).
Narrow to region, replace-string, widen, and transpose again.
Note that you may lose hlines when transposing.
You can transpose the table with org-table-transpose-table-at-point
, then select the relevant row (which used to be a column).
Narrow to region, replace-string, widen, and transpose again.
Note that you may lose hlines when transposing.
answered 1 hour ago
Juancho
3,811610
3,811610
add a comment |Â
add a comment |Â
up vote
1
down vote
You can select the column as a rectangular region using C-x SPC
(rectangle-mark-mode
) and then M-%
(query-replace
) will be
limited to that rectangle.
add a comment |Â
up vote
1
down vote
You can select the column as a rectangular region using C-x SPC
(rectangle-mark-mode
) and then M-%
(query-replace
) will be
limited to that rectangle.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
You can select the column as a rectangular region using C-x SPC
(rectangle-mark-mode
) and then M-%
(query-replace
) will be
limited to that rectangle.
You can select the column as a rectangular region using C-x SPC
(rectangle-mark-mode
) and then M-%
(query-replace
) will be
limited to that rectangle.
answered 22 mins ago
Omar
2,460825
2,460825
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f44994%2ftext-substitution-only-in-specific-column-of-org-table%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
See
region-extract-function
which is respected byquery-replace
. The tricky part is to get the buffer-positions of the table slice's rows.â politza
4 hours ago