Created
August 9, 2015 03:24
-
-
Save nickleeh/bc99ce5140852ce7f911 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -pe 's/\r(?!\n)//g' | |
perl -pe 's/\cM(?!\cJ)//g' | |
# The ?! construct is a negative look-ahead expression. The pattern matches a CR, but only when it is not followed by a LF. | |
#------------------------- | |
use strict; | |
use warnings; | |
my $a = "field1|field2|field3|fie^Mld4|fiel^Md5|field6^M"; | |
$a =~ s/\^M(?!$)//g; | |
print $a; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment