Change spaces to TABs

OzzieOzzie Posts: 50 Bronze 5
I inheirited lots of code indented with spaces. Is there a way to replaces spaces with a tab? Also to remove doubles spaces, space then a tab, etc - combinations of characters - a regex kind of solution.

I had been replacing every 2 spaces with 1 space, but that leaves me with code starting with a space - any way to remove all leading spaces?

Thanks,
Doug

Comments

  • When you use the Layout SQL option it should resolve most of the additional spaces and tab issues you have.

    However this does depend on the current layout and the options you have set.

    It is probably worth trying and seeing what happens as you can always undo and changes in the script window.

    Regards
    Dan
    Daniel Handley
    Red Gate Software Ltd
  • OzzieOzzie Posts: 50 Bronze 5
    Dan,

    When I run the Lay Out SQL option it uses spaces, not tabs - is there a way to make it use tabs?

    Also - it indents the begins with 4 spaces/tab - I don't like my BEGIN/END indented under my IFs - is there a way to turn this off?

    A specific answer would be appeciated, not a generalized recommendation - an order for Richard hinges on this capability (the tab vs space issue).

    TIA,
    Doug
  • There is currently no support for changing spaces to tabs within the options. You can alter the number of spaces inserted, and it replaces the current layout to make your script consistant throughout.

    The indentation of the BEGIN and END can be switched off by using one of the Schema statement options. Deselect Indent contents in the Content placement option.

    We are always looking at the options and how thwy are used. Unfortunatly we have to balance keeping the number of options to a usable amount against their practicallity. In developing the application there were requests for many nore options than are a avalable but to have put them all in would have made the product unusable.
    However we are reevaluating each time we work on a release and the use of tabs may be included next time.

    Regadrs
    Dan
    Daniel Handley
    Red Gate Software Ltd
Sign In or Register to comment.