I have a 4-column CSV file. I want to sort the lines, such that, the lines containing any number somewhere within the third column are pushed to the end of the document, lines without numbers in the third column are put to the beginning. How can I sort the file in this way?
Update:
To clarify, I need to move lines which contain any number (i.e. a match for [0-9]) somewhere within the letters of the third column (the third column of the line might contain other symbols). Spaces are not important. E.g.
dog, eats chicken, has 4 legs, does not like cats
cat, eats mice, has a tail, does not like water
mouse, eats bugs, has 4 legs, does not like cats
elephant, eats peanuts, has a trunk, does not like mice
Would be sorted to:
cat, eats mice, has a tail, does not like water
elephant, eats peanuts, has a trunk, does not like mice
dog, eats chicken, has 4 legs, does not like cats
mouse, eats bugs, has 4 legs, does not like cats
This might work for you:
Explanation: