Hi Sumathi,

first of all note this:

http://www.shlomifish.org/philosophy/computers/netiquette/email/start-new-thread.html

On Mon, 15 Jun 2015 13:12:53 +0530
suMathI gOkuL <sumathig2...@gmail.com> wrote:

> Hi Friends,
> 
> Please suggest me some idea to write perl code to join multiple lines into
> single line after a delimiter... For example i have the following code..
> 
> N22_pad_RNO : AO1
>       port map(A => un1_N3, B => N2_c, C => \N22_pad_RNO_0\, Y
>          => \N22_pad_RNO\);
> N3_pad : INBUF
>       port map(PAD => N3, Y => N3_c);
> 
> and want to modify as follows..
> 
> N22_pad_RNO : AO1 port map(A => un1_N3, B => N2_c, C =>
> \N22_pad_RNO_0\, Y => \N22_pad_RNO\); (in single line)
> 
> N3_pad : INBUF port map(PAD => N3, Y => N3_c);
> 
> Thank you all in advance....
> 

This is easy to do using:

1. loops - see the while, for/foreach, etc. loops.

2. File I/O - or use some of the modules here -
http://perl-begin.org/topics/files-and-directories/#modules

.

3. String concatenation - see the "." operator in
http://perldoc.perl.org/perlop.html .

4. chomp - see http://perlmaven.com/chomp

5. Possibly using regular expression search and replace - see
http://perl-begin.org/topics/regular-expressions/

==================

(*NOTE* : perl-begin.org is a site that I maintain).

A good programmer should be able to know how to construct a program that does
that out of all these mechanisms.

Regards,

        Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
What Makes Software Apps High Quality -  http://shlom.in/sw-quality

Chuck Norris won the Nobel Peace Prize. For making millions of people rest
in peace.
    — http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to