Skip/remove non-ascii character with sed

前端 未结 6 1023
孤街浪徒
孤街浪徒 2020-12-07 01:19

Chip,Dirkland,DrobæSphere Inc,cdirkland@hotmail.com,usa

I\'ve been trying to use sed to modify email addresses in a .csv but the line ab

6条回答
  •  日久生厌
    2020-12-07 01:48

    In this case there is a way to just skip non-ASCII chars, not bothering with removing.

    LANG=C sed /someemailpattern/
    

    See https://bugzilla.redhat.com/show_bug.cgi?id=440419 and Will sed (and others) corrupt non-ASCII files?.

提交回复
热议问题