Thank You mr_mischief , it helped me a lot...

but this code is affecting all the lines, I want to keep a line as it is if it contains anything other than white space and tabs.

For example I am changing the input and output to this,

Input,

TEST1 fgdfgb Test2 dlfgndkflgbn test3 /,g;dhjzmpa h7rg tRruber Test4 ';gfojmd ofimt lj kjbkhb The Product Manager is a deep expert on specific feature(s), service(s +) or interface(s) that Mimecast provides or sells. This could be a s +ervice delivered through the cloud, or installable software that cust +omers will use on their computers, SmartPhones, tablets and similar d +evices. For each product under your remit, you will have a good understanding +of the competitors in the market and their pricing, as well as the re +levance of the feature to IT administrators, users and customers. Yo +u will use this knowledge to formulate a roadmap of feature enhanceme +nts or, if required, the development of entirely new products and ser +vices. If this sounds like you, then please read onĀ….. You will be required to spend time sharing ideas and product concepts +with customers to gauge feedback, honing the feature pitch, and using + this information to assist the Product Director with pricing deliber +ations. dfgdfg Your role will see you managing development through the entire develop +ment lifecycle, whereafter you will be responsible for launching impr +ovements to Mimecast internally on a global scale. You will be comfo +rtable assisting with the authoring of collateral for web-sites, prin +table assets and to be integrated into appropriate media packs.

Desired output,

TEST1 fgdfgb Test2 dlfgndkflgbn test3 /,g;dhjzmpa h7rg tRruber Test4 ';gfojmd ofimt lj kjbkhb The Product Manager is a deep expert on specific feature(s), service(s +) or interface(s) that Mimecast provides or sells. This could be a se +rvice delivered through the cloud, or installable software that custo +mers will use on their computers, SmartPhones, tablets and similar de +vices. For each product under your remit, you will have a good understanding +of the competitors in the market and their pricing, as well as the re +levance of the feature to IT administrators, users and customers. You + will use this knowledge to formulate a roadmap of feature enhancemen +ts or, if required, the development of entirely new products and serv +ices. If this sounds like you, then please read onĀ….. You will be required to spend time sharing ideas and product concepts +with customers to gauge feedback, honing the feature pitch, and using + this information to assist the Product Director with pricing deliber +ations. dfgdfg Your role will see you managing development through the entire develop +ment lifecycle, whereafter you will be responsible for launching impr +ovements to Mimecast internally on a global scale. You will be comfo +rtable assisting with the authoring of collateral for web-sites, prin +table assets and to be integrated into appropriate media packs.

Many thanks,


In reply to Re^2: How to remove white space and more than a particular number of new lines! by Anonymous Monk
in thread How to remove white space and more than a particular number of new lines! by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.