freekngeek has asked for the wisdom of the Perl Monks concerning the following question:
Hi, All
I have text file which looks like this
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.*|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
I would appreciate any kind of help or ideas to build this script. Thank you
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Editing text file
by kcott (Archbishop) on Jun 18, 2013 at 13:03 UTC | |
Re: Editing text file
by hdb (Monsignor) on Jun 18, 2013 at 13:14 UTC | |
by CountZero (Bishop) on Jun 18, 2013 at 18:51 UTC | |
Re: Editing text file
by hbm (Hermit) on Jun 18, 2013 at 12:00 UTC | |
by choroba (Cardinal) on Jun 18, 2013 at 12:24 UTC |
Back to
Seekers of Perl Wisdom