I need to print all the lines containing non numeric characters using regex in sed.
The input is a csv, and some of it's lines has text and numbers. I'm interested in printing only those without numbers. This is what I tried:
sed -E -n '/^\D*$/p' direcciones.csv
Why it doesn't find anything?
Best Answer
@steeldriver already explained why your attempt didn't work (should work with GNU
sed
, though).But why not keep it simple? Printing all lines with only non-numeric characters is the same as dropping all lines with numeric characters:
Easier to write and easier to read, isn't it?