1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to Automatically Add Quotes to Begining and End of Line?

Discussion in 'BlackHat Lounge' started by agag2, Sep 16, 2011.

  1. agag2

    agag2 Supreme Member

    Joined:
    Feb 17, 2009
    Messages:
    1,308
    Likes Received:
    254
    Anyone know how to do this?

    (I'm talking about thousands of lines)

    thanks
     
    • Thanks Thanks x 1
  2. Kickflip

    Kickflip BANNED BANNED

    Joined:
    Jan 29, 2010
    Messages:
    2,038
    Likes Received:
    2,465
    I would just use a macro to click to the beginning of the next line and paste a quotation, then repeat for the end of the lines.
     
  3. Greybeard

    Greybeard Junior Member

    Joined:
    Aug 27, 2011
    Messages:
    185
    Likes Received:
    18
    I suppose you could also pay some rube to do it for you for a few cents or something. But a macro seems easier/cheaper.
     
  4. agag2

    agag2 Supreme Member

    Joined:
    Feb 17, 2009
    Messages:
    1,308
    Likes Received:
    254
    Inbult macros (note pad AA+) or something like winautomation?
     
  5. artizhay

    artizhay BANNED BANNED

    Joined:
    Nov 21, 2010
    Messages:
    1,867
    Likes Received:
    1,335
    If your text editor allows searching for special characters like \r and \n, then you can do a search-and-replace for
    and replace it with
    \r\n indicates a line break, so running the search and replace will first replace it with a " (adding it to the end of the line), then do a line break, then add another " (adding it to the beginning of the line).
    You will just have to add quotes to the beginning of the first line and the end of the last line. If \r\n doesn't work, just use \n

    Search Mode for this in Notepad++ is "Extended." Different settings will apply to different programs.
     
    • Thanks Thanks x 2
  6. OldFatGuy

    OldFatGuy Regular Member

    Joined:
    Jun 4, 2009
    Messages:
    253
    Likes Received:
    149
    EditPlus with a keyboard macro...

    HOME to start of line
    Ctrl-Q to start recordnig macro
    " then END to end of line, then another ", then HOME to start of line and DOWN to next line
    Ctrl-Q to end macro record
    Then Tools->Record->Playback Multiple
    Select macro and click stop at end of file

    Done in a few seconds.
     
  7. Kickflip

    Kickflip BANNED BANNED

    Joined:
    Jan 29, 2010
    Messages:
    2,038
    Likes Received:
    2,465
    Any keyword/mouse macro is what I use for jobs like this. Tasker type programs. I just set and walk away from keyword for a bit, then come back and check my work.
     
  8. agag2

    agag2 Supreme Member

    Joined:
    Feb 17, 2009
    Messages:
    1,308
    Likes Received:
    254
    thanks - great answer

    is there any way to move the quote to the end of the line instead of the next line?
     
  9. artizhay

    artizhay BANNED BANNED

    Joined:
    Nov 21, 2010
    Messages:
    1,867
    Likes Received:
    1,335
    ?

    That should do what you want it to do, given I understood your OP correctly.

    Say your file has this:
    Search-and-replace would make it this:
    And you just have to add " to the beginning of line 1 and end of last line.
     
  10. mightybh

    mightybh Jr. VIP Jr. VIP Premium Member

    Joined:
    Feb 27, 2008
    Messages:
    1,029
    Likes Received:
    1,714
    Occupation:
    CEO
    Location:
    UK
  11. judson

    judson Power Member

    Joined:
    Nov 29, 2009
    Messages:
    530
    Likes Received:
    319
    Occupation:
    Fulltime Newbie IM
    Location:
    Sub Ubi
    Macros are overkill for this.

    Just do a search-and-replace for this, like artizhay recommends.
     
  12. lurnme

    lurnme Regular Member

    Joined:
    Jul 16, 2008
    Messages:
    309
    Likes Received:
    93
    Yeah Notepad++ is set to default text here. Get it, it's free. The extended and regex options for replacing a huge time saver. Also has some great built in options to save time..