Created
May 13, 2011 18:07
-
-
Save betawaffle/971012 to your computer and use it in GitHub Desktop.
Linear Regex Replaces with Perl
This file contains hidden or 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
#!/usr/bin/perl -w | |
use strict; | |
while (<>) { | |
s/\t/|/g; # Convert Tabs to Pipes | |
s/\r?\n/[]\r\n/g; # Add [] at EOL and Convert to CRLF | |
s/^\|+\[\]\r\n//g; # Remove Empty Lines | |
print; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment