Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: how to append 2 lines

by aitap (Deacon)
on Aug 31, 2012 at 10:10 UTC ( #990968=note: print w/ replies, xml ) Need Help??


in reply to how to append 2 lines

Please show us your code, so it will be easier for us to help you. Read How do I post a question effectively? for more info.

Sorry if my advice was wrong.


Comment on Re: how to append 2 lines
Re^2: how to append 2 lines
by suno (Acolyte) on Aug 31, 2012 at 10:16 UTC

    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
      Ok, but that is only DATA, that is not perl

      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://990968]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2014-07-11 13:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (224 votes), past polls