Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: how to append 2 lines

by aitap (Curate)
on Aug 31, 2012 at 10:10 UTC ( [id://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.

Replies are listed 'Best First'.
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

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-24 17:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found