Text substitution only in specific column of org table

The name of the pictureThe name of the pictureThe name of the pictureClash 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?










share|improve this question





















  • 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















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?










share|improve this question





















  • 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













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?










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 5 hours ago









UTF-8

342115




342115











  • 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
















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











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.






share|improve this answer



























    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.






    share|improve this answer




















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "583"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













       

      draft saved


      draft discarded


















      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






























      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.






      share|improve this answer
























        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.






        share|improve this answer






















          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.






          share|improve this answer












          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 1 hour ago









          Juancho

          3,811610




          3,811610




















              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.






              share|improve this answer
























                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.






                share|improve this answer






















                  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.






                  share|improve this answer












                  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.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 22 mins ago









                  Omar

                  2,460825




                  2,460825



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      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













































































                      Comments

                      Popular posts from this blog

                      What does second last employer means? [closed]

                      Installing NextGIS Connect into QGIS 3?

                      One-line joke