Hi, All

I have text file which looks like this

*|DSPF 1.0 * *|DESIGN "TOP_1b_1a" *|DATE "Tue Jun 18 11:42:12 2013" *|VENDOR "Mentor Graphics Corp." *|PROGRAM "Calibre xRC v2012.2_36.25" *|DIVIDER / *|DELIMITER : * Nominal Temperature: 25C * Circuit Temperature: 25C * .subckt TOP_1b_1a PC_M1_M2_50_500_50_500_50_500_50_500_50_bot + PC_M1_M2_50_100_50_100_50_100_50_100_50_bot + PC_M1_M2_500_250_500_250_500_250_500_250_500_ctr * PC_M1_M2_500_250_500_250_500_250_500_250_500_low + PC_M1_M2_75_500_75_500_75_500_75_500_75_bot + PC_M1_M2_75_100_75_100_75_100_75_100_75_bot * PC_M1_M2_150_50_150_50_150_50_150_50_150_high + PC_M1_M2_100_500_100_500_100_500_100_500_100_bot + PC_M1_M2_100_100_100_100_100_100_100_100_100_bot rM6_M7_JA_50_100_50_100_50_100_50_100_50_ctr/0 R435:pos + M6_M7_JA_50_100_50_100_50_100_50_100_50_ctr 238.22 rM6_M7_JA_50_100_50_100_50_100_50_100_50_ctr/1 R434:neg + M6_M7_JA_50_100_50_100_50_100_50_100_50_ctr 238.22 * *|NET M6_M7_JA_50_100_50_100_50_100_50_100_50_high 0.0 *|I (R435:neg R435 neg B 0.0 10 3151) R0 R0:pos R0:neg lvsres R=0.001 $X=9.975 $Y=10.999 R1 R1:pos R1:neg lvsres R=0.001 $X=9.975 $Y=122 R2 R2:pos R2:neg lvsres R=0.001 $X=9.975 $Y=243.999 R3 R3:pos R3:neg lvsres R=0.001 $X=9.975 $Y=355 R4 R4:pos R4:neg lvsres R=0.001 $X=159.963 $Y=10.999 R5 R5:pos R5:neg lvsres R=0.001 $X=159.963 $Y=122
What I want is to edit my text file using perl script. I want all the lines to be in one line which start with '+' sign, and leave rest of lines as it is. So, whenever it encounters '+' sign, script should print all the lines in one single line and then removes the '+' sign.

I would appreciate any kind of help or ideas to build this script. Thank you


In reply to Editing text file by freekngeek

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.