I want to delete all lines from a file that has no form:
something.something, something, something
For example, if the file was as follows:
A sentence, some words ABCD.CP3,GHD,HDID Hello. How are you? AB,C,D dbibb.yes,whoami,words
I would stay with:
ABCD.CP3,GHD,HDID AB,C,D dbibb.yes,whoami,words
I tried going to the end of the sed script if I agree with the pattern that I don't want to delete, but continue and delete the line if it doesn't match:
cp $file{,.tmp} sed "/^.+\..+,.+,.+$/b; /.+/d" "$file.tmp" > $file rm "$file.tmp"
but this does not seem to have any effect.
I suppose that I could read the file line by line, check if the template matches the template, and output it to the file, if so, but I would like to do it with sed or similar.