Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Mon Nov 19, 2018 12:22 pm


Tips & Tricks, Questions regarding shell scripts, awk, perl, sed and much more.

Author Message
mandrei99
Post  Post subject: Removing new line / EoL characters in a PERL script  |  Posted: Mon Nov 04, 2013 6:47 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 250

Offline
 

Removing new line / EoL characters in a PERL script

Use either of the two methods (probably more) of removing new line characters from an input in a perl script
Code:
my $line = "This contains a new line. \r\n";
chomp($line);

or
Code:
my $line = "This contains a new line. \r\n";
$line =~ .s/[\x0A\x0D]//g;





Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "Removing new line / EoL characters in a PERL script"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. How to replace new line in perl script

mandrei99

1

2657

Wed Jun 26, 2013 8:18 am

admin View the latest post

There are no new unread posts for this topic. PERL: How to replace non-ascii characters/bytes in a file

admin

0

1894

Fri Apr 10, 2015 8:58 am

admin View the latest post

There are no new unread posts for this topic. Attachment(s) Juniper SRX - Perl script - SNMP based RRDtool graphis from CPU usage and Flow Session (current)

mandrei99

1

3771

Mon Nov 04, 2013 11:47 am

mandrei99 View the latest post

There are no new unread posts for this topic. Echo new line in linux - supress new line or echo multiple new lines

mandrei99

0

3667

Wed Jan 14, 2015 5:26 pm

mandrei99 View the latest post

There are no new unread posts for this topic. SED uncomment line - How to uncomment a line or all lines with SED

mandrei99

0

4890

Wed Jan 14, 2015 5:08 pm

mandrei99 View the latest post

There are no new unread posts for this topic. Password generator with user inputs bash script

Kvr123

0

950

Thu Dec 01, 2016 5:06 am

Kvr123 View the latest post

There are no new unread posts for this topic. BASH shell script to mointor a directory and move file without overwriting destination

admin

0

587

Wed Nov 15, 2017 7:48 am

admin View the latest post

There are no new unread posts for this topic. How to convert a text into a list of words, one per line

LaR3

0

6692

Wed Aug 05, 2009 7:02 am

LaR3 View the latest post

There are no new unread posts for this topic. How to replace \w SED multiple matches on the same line without piping

mandrei99

0

1877

Tue Oct 08, 2013 6:29 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to add line numbers in unix shell output

mandrei99

0

1532

Fri Oct 31, 2014 5:31 am

mandrei99 View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
News News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO