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

Re^2: how to append 2 lines

by suno (Acolyte)
on Aug 31, 2012 at 10:16 UTC ( [id://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

Replies are listed 'Best First'.
Re^3: how to append 2 lines
by aitap (Curate) 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.
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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-19 18:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found