How to output non-number lines with grep?

I want to check my data quality. I want to output the lines with non-number. I used the grep command:
grep '[^0-9,. ]' myfile.csv
Since my file is csv file, I don't want to output the lines with comma. And I also don't want to output "." or space. But I still get the lines like the following:

1,66.2,16.57,0, ,,,, ,,86,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,0,,,,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,2,,,0,

Is there anything wrong with my code?

grep '[^0-9,. ]' twotwo.csv on a sample file, produces nothing. Which is correct.
Could you provide a larger sample file using code tags.
Also, provide the output of cat -vet mySampleCSV.csv (using code tags as well).

Thank you for your reply. I uploaded my file. Can you see twotwo.txt. Since the forum cannot upload the csv file, I changed the extend name to txt. But it is actually a csv file. I used the same code on this file, but not work. It still output all of those three lines. Can you re-produce that?

this is a case of Windows file have a traling '^M' (line-feed) - had you provided a cat -vet output as asked, you would have seen it as well.
Run dos2unix mySampleFile and re-run your grep .

1 Like

Great. It works. Thank you!

there is also the option "-v"

grep -v '[0-9,.]'

Thank you, nezabudka.

There is a small but significant difference:
grep '[^0-9,. ]' prints lines that have a bad character
grep -v '[0-9,. ]' prints lines that do not have a good character (i.e. all bad)

Got it. Thank you!