Skip to content

Instantly share code, notes, and snippets.

@ujaehrig
Created December 11, 2019 09:38
Show Gist options
  • Save ujaehrig/977ccba2265b52793d5a71584b6e210c to your computer and use it in GitHub Desktop.
Save ujaehrig/977ccba2265b52793d5a71584b6e210c to your computer and use it in GitHub Desktop.
Remove leading and trailing quote, replace common escapes with their unescaped counterpart
#!/usr/bin/perl
use warnings;
while(my $line = <STDIN>) {
$line =~ s/\\t/\t/g;
$line =~ s/\\n/\n/g;
$line =~ s/^\"//g;
$line =~ s/\"$//g;
$line =~ s/\\\"/\"/g;
print $line;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment