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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:03:39+00:00 2026-05-31T02:03:39+00:00

in my current ASP.net MVC 3.0 project i am stuck with a situation. I

  • 0

in my current ASP.net MVC 3.0 project i am stuck with a situation.

  1. I have four .txt files each has approximatly 100k rows of records
  2. These files will be replaced with new files on weekly bases.

I need to Query data from these four text files, I am not able to choose the best and efficient way to do this.

3 ways I could think

  1. Convert these text files to XML on a weekly basis and query it with Linq-XML
  2. Run a batch import weekly from txt to SQL Server and query using Linq-Entities
  3. avoid all conversions and query directly from text files.

Can any one suggest a best way to deal with this situation.

update:


Url of the Text File
URL to access the txt File with credentials
I should connect to this file with credentials.

once i connect successfully, I will have the text file as below with Pipeline as Deliminator
This is the text file


Data in Text File is as this
Now i have to look up for the field highlighted in yellow and get the data in that row.

Note: First two lines of the text file are headers of the File.

  • 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-05-31T02:03:40+00:00Added an answer on May 31, 2026 at 2:03 am

    Well As i Found a way my self. Hope this will be useful for any who are interested to get this done.

    string url = "https://myurl.com/folder/file.txt";
    WebClient request = new WebClient();
                    request.Credentials = new NetworkCredential(ConfigurationManager.AppSettings["UserName"], ConfigurationManager.AppSettings["Password"]);
                    Stream s = request.OpenRead(url);
                    using (StreamReader strReader = new StreamReader(s))
                    {
                        for (int i = 0; i <= 1; i++)
                            strReader.ReadLine();
                        while (!strReader.EndOfStream)
                        {
                            var CurrentLine = strReader.ReadLine();
                            var count = CurrentLine.Split('|').Count();
                            if (count > 3 && CurrentLine.Split('|')[3].Equals("SearchString"))
                            {
                                #region Bind Data to Model
                                //var Line = CurrentLine.Split('|');
                                //CID.RecordType = Line[0];
                                //CID.ChangeIdentifier = Line[1];
                                //CID.CoverageID = Convert.ToInt32(Line[2]);
                                //CID.NationalDrugCode = Line[3];
                                //CID.DrugQualifier = Convert.ToInt32(Line[4]); 
                                #endregion
                                break;
                            }
                        }
                        s.Close();
                    }
                    request.Dispose();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to run ELMAH with my ASP.NET MVC 2 project but have some
I'm currently using jqGrid and ASP.Net MVC. With my current project, my goal is
In my ASP.NET MVC project i need to select all text boxes that have
I was debugging my current project (ASP.net MVC 1.0 project) and stumbled upon slightly
I've an ASP.NET MVC project that has a sub folder called emails. This contains
I have an Asp.Net MVC project. I added login with Google button. It appears
i have a problem in MVC ASP.NET project. i work with LINQ technology.When i
In my ASP.NET MVC project, I have a custom ModelMetadataProvider that requires a service
I have an Asp.net MVC 3 project with name of abc. It shows http://localhost:23543/abc/....
Does anyone have any information about getting the current versions of ASP.NET MVC (Preview

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.