beecha has asked for the wisdom of the Perl Monks concerning the following question:
HI All,
happy new year
i am reading text file which contains below multiple lines.
i am reading every line one by one as a string. if the line is started with WAR i need to check for '{' and make all the line into a single line till it ends with '}' without considering the '&' character
EX:
war eligible, init =0*DEC0, ev (VARIABLE){1*BIN0,2*DEC3,6*BIN4, & 5*BIN43,6*DEC32, & 5*BIN43,7*DEC32}
CONVERTED TO:
war eligible, init =0*DEC0, ev (VARIABLE){1*BIN0,2*DEC3,6*BIN4,5*BIN43 +,6*DEC32, 5*BIN43,7*DEC32}
war wear, init =1*DEC1, ev (VARIABLE) { & 1*BIN0,2*DEC3,6*BIN4, & 5*BIN43,6*DEC32, & 5*BIN43,7*DEC32,6*DEC32,6*DEC3, & 8*BIN3,6*DEC34 }
CONVERTED TO:
war wear, init =1*DEC1, ev (VARIABLE) { 1*BIN0,2*DEC3,6*BIN4, 5*BIN43, +6*DEC32, 5*BIN43,7*DEC32,6*DEC32,6*DEC3, 8*BIN3,6*DEC34 }
please help me with this how to convert.
2018-01-09 Athanasius added code and paragraph tags
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Converting multiple lines into single line.
by Laurent_R (Canon) on Jan 09, 2018 at 14:41 UTC | |
Re: Converting multiple lines into single line.
by Eily (Monsignor) on Jan 09, 2018 at 13:33 UTC | |
Re: Converting multiple lines into single line.
by tybalt89 (Monsignor) on Jan 09, 2018 at 15:44 UTC | |
Re: Converting multiple lines into single line.
by tybalt89 (Monsignor) on Jan 09, 2018 at 22:37 UTC |
Back to
Seekers of Perl Wisdom