Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4013998
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:26:29+00:00 2026-05-20T09:26:29+00:00

I have a text file with about 100,000 lines (5 MB), which is updated

  • 0

I have a text file with about 100,000 lines (5 MB), which is updated once a day. It grows at a rate of about 30 lines a day. The lines are not sorted in any way. Each line is 50 hex characters long and looks like this:

ABCDE9DAF1F66C10C02F25A1685821F8428422F5870F39A3FE

Given one of these strings, I need to figure out if it exists in this file. I am working with C# (.NET CF 2.0) on a handheld device, so memory is limited. I have the ability to process the file before hand on a Windows server. What is the fastest way to do this? Some of my initial ideas include: sorting the file, line by line string compare, creating a binary file to search, or using SQLite.

From OP’s comments (an important one, which was left out from the question initially):

The file is read-only. No changes will
ever be made by my programs. I get a
new version of the file each day with
more strings appended to the end

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:26:30+00:00Added an answer on May 20, 2026 at 9:26 am

    Optimal way to do this would probably be to pre-sort the file on the server, and use memory mapped files to do a binary search of the file. That being said, .NET CF 2.0 won’t have support for memory mapped files.

    You’re probably best off just pre-sorting the file, and using stream access to perform a binary search on the file. It’s not great because you don’t have sequential reads, but seeing as you’re on CF, there is a good chance your data store on the device is flash based, so the random access for the binary search probably won’t be too bad…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file of about 100 million lines in which I want to
We have a text file with about 100,000 rows, about 50 columns per row,
I have a 100 GB text file, which is a BCP dump from a
I have a giant text file (about 1,5 gigabyte) with xml data in it.
I have a text file of URLs, about 14000. Below is a couple of
I have about 600 text files. Each file contains 2 columns and is space
I have a text file that contains about 100000 articles. The structure of file
Say I have a text file formatted like this: 100 20 the birds are
I have a text file which has first line as below: j0W82LBrSdUbw Basically it
I have text file with some stuff that i would like to put into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.