Join Lines in Notepad++

kpkdhar22
2013-02-13
2013-02-21
  • kpkdhar22

    kpkdhar22 - 2013-02-13

    I have a text that is converted from a pdf file into text. so the text document shows like, to a max col length of 120.

    1 Thus think twice before taking the plunge. But make sure that if once you have made the choice to become
    2 an IAS, there should be no looking back. During the whole process you might face failure, sometimes you
    3 will doubt your ability, may have to start from square one after reaching up to the last stage. Here is the real
    4 test of your mental strengths rather than your intellectual abilities. In one way or another the whole process
    5 of exam is a life changing one, whether you come out successful or unsuccessful. It matters a lot for the life
    6 of yours and your loved ones. You have to sail through each and every aspects of all these events.
    7
    8 At the same time it becomes essential to make a realistic assessment of your potential otherwise the
    optimum years of your career are lost in chasing a subtle target. It is advisable to prepare yourself for the
    9 civil service in the graduation years by identifying the weak and strong points and familiarizing yourself
    10 with the syllabus and pattern of examination. It is seen that those who have taken the exam as soon as they

    11 become eligible are better than then the others so it is best to take the exam as soon as you are eligible.
    12 However here keep your other options open for your career as a safety net.

    I am joining the lines using a short cut. and making it like this.

    1 Thus think twice before taking the plunge. But make sure that if once you have made the choice to become an IAS, there should be no looking back. During the whole process you might face failure, sometimes you will doubt your ability, may have to start from square one after reaching up to the last stage. Here is the real test of your mental strengths rather than your intellectual abilities. In one way or another the whole process of exam is a life changing one, whether you come out successful or unsuccessful. It matters a lot for the life of yours and your loved ones. You have to sail through each and every aspects of all these events.
    2
    3 At the same time it becomes essential to make a realistic assessment of your potential otherwise the optimum years of your career are lost in chasing a subtle target. It is advisable to prepare yourself for the civil service in the graduation years by identifying the weak and strong points and familiarizing yourself with the syllabus and pattern of examination. It is seen that those who have taken the exam as soon as they become eligible are better than then the others so it is best to take the exam as soon as you are eligible. However here keep your other options open for your career as a safety net.

    My document is having thousands of lines, and I want to combine these broken lines into a single para or line. I want to leave the blank lines as it is.
    
    Is there anyway I can join these broken lines at a time.
    
     
  • cchris

    cchris - 2013-02-17

    Do the 1 ,2 and so on belong to your original file? I suspect they don't.
    One way to proceed could be to somehow turn blank lines nonblank, join and then resurrect blank lines:
    1/ using regexp mode
    Find ^\s*$
    Replace with § (or anything weird but easy to type)
    2/
    Join lines (or Edit -> LBlank operations -> Turn EOL to spaces)
    3/ in extended or regexp mode
    Find §
    Replace with \r\n\r\n

    CChris

     
  • kpkdhar22

    kpkdhar22 - 2013-02-20

    Thanks for your reply, I will try and let you know. it seem to be working. Thanks

     
  • GerdB

    GerdB - 2013-02-21

    You may also consider the following (remove the quotes):

    • in regex mode search for "(?<!\r\n)\r\n(?!\r\n)"
    • replace with " " (single space)

    This will replace any stand-alone linebreak with a single space while keeping empty lines. Note that you can't use the match-any-linebreak escape "\R". For more Information about regex syntax see http://www.boost.org/doc/libs/1_53_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html