Fastest way to filter fields? #1893
Unanswered
SlothCroissant
asked this question in
Q&A
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
First off, love the CsvHelper tool, it's been wildly useful for me in recent weeks!
I have a CSV file with ~15 million rows. The first column is an IP address, and the CSV file is filtered by A-Z on this column (meaning 0.x.x.x.x then 1.x.x.x then 2.x.x.x then 3.x.x.x.x and so on).
My goal is to parse/filter the CSV file by first octet of the IP Address. So 1.2.3.4 would be filtered as "1", and in my use case, I could pull out all IPs that start with "1."
I'd like to filter this by every octet (0..255) and I'm looking for the fastest way to do it. Currently, I can runa GetRecords() and use ShouldSkipRecord to do the work, but I'm mostly curious to see if I can do it more efficiently/quickly.
Sample code that works now that I'd like to optimize a bit:
Beta Was this translation helpful? Give feedback.
All reactions