How can we help you today? How can we help you today?

extra linefeed/carriage return characters

Need to remove extra linefeed/carriage return characters. Often a script comes from Outlook or the newsgroups with extra lines like:

SELECT column

FROM table

WHERE a=b

AND c=d

And this is really annoying. The refactor should take care of these, even if it isn't making any other changes to the layout.
drsql
0

Comments

5 comments

  • Andras B
    drsql wrote:
    Need to remove extra linefeed/carriage return characters. Often a script comes from Outlook or the newsgroups with extra lines like:

    SELECT column

    FROM table

    WHERE a=b

    AND c=d

    And this is really annoying. The refactor should take care of these, even if it isn't making any other changes to the layout.

    Sorry, this is a refactoring we would not consider, but there is a very simple workaround.

    Press Ctrl-H in Management Studio (or just use the replace dialog using the menues). Set it to use regular expressions, and then type in to replace
    ^$\n
    with nothing

    This will get rid of empty lines from your code.

    Regards,
    Andras
    Andras B
    0
  • drsql
    Why wouldn't you consider it? I agree that you couldn't do this as a part of the primary refactoring, since it could remove wanted blank lines, but it could just be a seperate menu item that says remove double blank lines (particularly for a selection.)

    I do understand and either way, thanks for the tip with regular expressions :)
    drsql
    0
  • Andras B
    drsql wrote:
    Why wouldn't you consider it? I agree that you couldn't do this as a part of the primary refactoring, since it could remove wanted blank lines, but it could just be a seperate menu item that says remove double blank lines (particularly for a selection.)

    I do understand and either way, thanks for the tip with regular expressions :)

    We have over 14 refactorings at the moment (we will include them in the next beta), all of which do quite a lot and workarounds would take more time. But if there is enough support for this refactoring we will include it in future versions.

    Andras
    Andras B
    0
  • drsql
    That is cool. My reply might have sounded curt, but I was just interested in why you wouldn't consider it. ("Not consider" was strongish language, so I was interested if it was a dumb idea :))

    I like the refactorings (word?) you have now (it is probably going to be one of the best addins to any product I have ever used, personally), but the main thing I would use would be the code reformatting. It is one of those features that I will use daily, and would be totally worth the price.
    drsql
    0
  • Andras B
    drsql wrote:
    That is cool. My reply might have sounded curt, but I was just interested in why you wouldn't consider it. ("Not consider" was strongish language, so I was interested if it was a dumb idea :))

    I like the refactorings (word?) you have now (it is probably going to be one of the best addins to any product I have ever used, personally), but the main thing I would use would be the code reformatting. It is one of those features that I will use daily, and would be totally worth the price.
    The idea was certainly not dumb. This is a 1.0 version, so initially we try to include refactorings that have a relatively high value without any easy workarounds. Removing the double lines can be easily worked around with a regular expression in Management Studio, but the workaround is clearly not as comfortable as invoking one of our refactorings.
    Under "Not considered" I meant that it did not make the final list of refactoring we include in the first release, but it is certinly not forgotten, and it is filed for the future when we decide on more refactorings :).

    Thank you for all the support, we aim to make to product even nicer.

    Regards,
    Andras
    Andras B
    0

Add comment

Please sign in to leave a comment.