# How to (efficiently) filter a file/stream on-the-fly?

**URL:** <https://discourse.julialang.org/t/how-to-efficiently-filter-a-file-stream-on-the-fly/122457>\
**Category:** Performance\
**Tags:** io, file\
**Created:** [November 9, 2024, 9:33pm UTC](https://discourse.julialang.org/t/how-to-efficiently-filter-a-file-stream-on-the-fly/122457 "2024-11-09T21:33:56Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [November 10, 2024, 1:11pm UTC](https://discourse.julialang.org/t/how-to-efficiently-filter-a-file-stream-on-the-fly/122457/4 "2024-11-10T13:11:34Z")

</div>

> [@lmiq](#):
>
> ps: I wish [CSV.jl](https://juliahub.com/ui/Packages/General/CSV) had filtering options for these kind of requirement

Have you tried `Iterators.filter` together with `CSV.Rows` as in [this solution](https://discourse.julialang.org/t/reading-a-few-rows-from-a-big-csv-file/68611/16)?

Or `TableOperations.filter` as suggested further down in the same thread.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-efficiently-filter-a-file-stream-on-the-fly/122457)._
