Menu

Yet another "tabs to spaces" post

José E
2009-06-26
2012-11-13
  • José E

    José E - 2009-06-26

    Hi:
    Is there any way to replace all tabs into the corresponding spaces, i.e. if I have:

    {TAB}1234
    1{TAB}234
    12{TAB}34
    123{TAB}4

    {TAB} should be replaced in the first line by 4 spaces, OK you can search-replace \t by 4 spaces, but in the second line by 3 spaces and so on and this is not so easy
    Npp does it "on the fly" perfectly while you write with the "Replace by space" checkbox and the TextFX Edit command "Leading spaces to tabs or tabs to spaces" works fine for the leading spaces, but I need some way do replace correctly text pasted from excel (with tabs between the text).

    Does anyone knows any trick for doing so?

    Thanks in advance and kind regards

    José E

     
    • José E

      José E - 2009-07-01

      Thanks for the response, but I can only use Unicode and the functions of the plugin (at least those in Functions.xml)doesn't allow check the current char or replace

      Regards

      José E

       
    • cchris

      cchris - 2009-06-26

      Does cutting the text from the whole document and pasting it in a new document perform conversion on the fly??

      CChris

       
    • José E

      José E - 2009-06-29

      Thanks for the reply, but it doesn't do the conversion neither pasting from excel nor pastin from another Npp tab.

      Regards,

      José E

       
    • cchris

      cchris - 2009-06-29

      I'd suggest using the SimpleScript or NppJavaScript plugin. The former would be more straightforward to use, but is ANSI only. The latter is Unicode only.

      CChris

       
MongoDB Logo MongoDB