1

If I wrote a program that can exclude all the lines in a computer file that are more than 200 characters long, should it be

  1. it can filter all the lines more 200 characters long
  2. it can filter out all the lines more 200 characters long
  3. it can filter away all the lines more 200 characters long

The (2) above seem to be able to mean to exclude those lines or to select those lines.

  • 1. doesn't do it; 3. is very rare; 2. is what you want. – user105719 Feb 4 '20 at 8:49
  • @user105719 are you sure (2) means (a) "getting all lines more than 200 characters long" or (b) "excluding all lines more than 200 characters long"? – nonopolarity Feb 4 '20 at 9:24
  • What you end up with depends on the circumstances. If you have an impurity and filter it out, then you discard what's filtered out and keep the pure remainder. If you have something valuable, like gold or U-235, and filter it out of a worthless substrate, then you keep what's filtered. What's the object of your filter -- to keep the long lines or discard them? In either case the preferred idiom is "filter out." – user105719 Feb 4 '20 at 10:27
  • @user105719 yeah... that's why I thought it sounded right to say, "filter out the short lines" or "filter out the long lines" to mean the same thing... – nonopolarity Feb 4 '20 at 10:53
1

"Filter" is the process of separating things. If you want to use it to specify the things you have removed, you could say "filter out".

Examples:

I filter my water.

I filter out impurities from my water.


I filter all the lines.

I filter out all the lines over 200 characters in length.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.