Skip to main content
added 5 characters in body
Source Link
JJoao
  • 12.8k
  • 1
  • 26
  • 45

Using Perl (sorry: obfuscating code)

perl -pe 's/".*?"/ $& =~ tr[|][]dr /ge'     file

Explanation:

  • perl -pe proc - apply procproc to all the lines
  • s/RE/ f($&) /ge - substitutes RERE by the result of f(matching string)
  • tr[|][]dr - translates | by nothing (=deletes)

Using Perl (sorry: obfuscating code)

perl -pe 's/".*?"/ $& =~ tr[|][]dr /ge'     file

Explanation

  • perl -pe proc - apply proc to all the lines
  • s/RE/ f($&) /ge - substitutes RE by the result of f(matching string)
  • tr[|][]dr - translates | by nothing (=deletes)

Using Perl (sorry: obfuscating code)

perl -pe 's/".*?"/ $& =~ tr[|][]dr /ge'     file

Explanation:

  • perl -pe proc - apply proc to all the lines
  • s/RE/ f($&) /ge - substitutes RE by the result of f(matching string)
  • tr[|][]dr - translates | by nothing (=deletes)
Source Link
JJoao
  • 12.8k
  • 1
  • 26
  • 45

Using Perl (sorry: obfuscating code)

perl -pe 's/".*?"/ $& =~ tr[|][]dr /ge'     file

Explanation

  • perl -pe proc - apply proc to all the lines
  • s/RE/ f($&) /ge - substitutes RE by the result of f(matching string)
  • tr[|][]dr - translates | by nothing (=deletes)