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 7908495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:58:20+00:00 2026-06-03T11:58:20+00:00

I have a large txt file thar I want to parse in my web

  • 0

I have a large txt file thar I want to parse in my web application. Earlier, I had the same application as a kind of desktop application, and I did the parsing one time during the Load, and briong the contents of file into memory.

Here in ASP.NET website, I am not sure if I should be doing this in Page_Load() since parsing a 13Mb text file would make this slow for the user everytime. What should I do to bring this one time into memory and then for all the users, the same in-memory parsed contents can be looked up?

  • 1 1 Answer
  • 0 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-06-03T11:58:21+00:00Added an answer on June 3, 2026 at 11:58 am

    If your file is same for all the users you can put in cache provided by asp.net. If it is specific to user then session could be a place for it but that will acquire a lot of memory and make it almost devastating. This is how you can Cache file in asp.net

    string fileContent = Cache["SampleFile"] as string;
    if (string.IsNullOrEmpty(fileContent))
    {
        using (StreamReader sr = File.OpenText(Server.MapPath("~/SampleFile.txt")))
       {
           fileContent = sr.ReadToEnd();
           Cache.Insert("SampleFile", fileContent, new System.Web.Caching.CacheDependency(Server.MapPath("~/SampleFile.txt")));
       }
    }   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a really large file foo.txt and I want to iterate
I have a large .txt file of records that I need to convert into
I have a large .txt file, a part of which is shown below -
I have this large (and oddly formatted txt file) from the USDA's website. It
I have this large txt file 8mb+ that is delimited and I need to
I have a large txt file space delimited which I split into 18 smaller
Say I have a large file done.txt Then I have another large file post.txt
I have the following PowerShell script that will parse some very large file for
So I have a large txt file with such contents (like 20mbs long) 20
I have a large txt file, which contains blocks of data as follows: AB

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.