Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: how to append 2 lines

by suno (Acolyte)
on Aug 31, 2012 at 10:16 UTC ( #990969=note: print w/ replies, xml ) Need Help??


in reply to Re: how to append 2 lines
in thread how to append 2 lines

Hi,here is the sample input code...

LABEL#00001 MVC SYMBOL+2(4),X.PDES_KEY+2 + MVC SYMB_ART,=C'XSEQ' //line comments + + F$SFH SELECT,LISTING, + * DESKART=SYMB_ART, + * DESKWERT=SYMBOL, + * MARKTCODE=L#MACF + BNE F03#000 //line comments

my required output should be somewhat like this...

LABEL#00001 MVC SYMBOL+2(4),X.PDES_KEY+2 + MVC SYMB_ART,=C'XSEQ' //line comments + + F$SFH SELECT,LISTING,DESKART=SYMB_ART,DESKWERT=SYMBOL,MARKTCO +DE=L#MACF BNE F03#000 //line comments


Comment on Re^2: how to append 2 lines
Select or Download Code
Re^3: how to append 2 lines
by Anonymous Monk on Aug 31, 2012 at 10:30 UTC
    Ok, but that is only DATA, that is not perl
Re^3: how to append 2 lines
by aitap (Deacon) on Aug 31, 2012 at 10:32 UTC

    And your Perl code to join the lines is...

    Hint: use three-argument form of substr to check the 72nd symbol of the line and use it again to replace the text. For example:

    my $one = ("_"x9)."*__\n"; my $two = ("-"x15)."\n"; print "$one$two"; substr($one,9)="" if substr($one,9,1) eq "*"; print "$one$two";

    Sorry if my advice was wrong.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://990969]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2014-07-31 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (248 votes), past polls