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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:00:28+00:00 2026-06-04T18:00:28+00:00

I need an idea on how to read text file data between quotes. For

  • 0

I need an “idea” on how to read text file data between quotes. For example:

line 1: "read a title"

line 2: "read a descr"

line 1: "read a title"

line 2: "read a descr"

I want to do a foreach type of thing, and I want to read all Line 1’s, and Line 2’s as a pair, but between the “.

In my program I am going to output (foreach of course):

readTerminatedNull(file1);

readTerminatedNull(file2);

I would read line by line, but some of the text could be:

line 1: "read a super long
title that goes off"
line 2: "read a descr"

So that’s why I want to read between the “.

Sorry if that is too complicated, and it’s a little hard to explain.

Edit:
Thanks for all the feed back guys, but I’m not sure you are getting what I am trying to do :p not your faults, I wrote this kinda wierd.

I will have a text file full of refrences, and text. like so.

text inside:

Refren: "myrefrence_1"
String: "This is a string of a refrence"
Refren: "myrefrence_2"
String: "hello world"
Refren: "myrefrence_3"
String: "I like cookies."

I want it to to read myrefrence_1 in the quotes of the first line, and then read the string in the next line between the “.

I will then stuff into my program that matches the refrence with the string.

But sometimes the text will be more than one line.

Refren: "this is text that goes and then
return keys on some parts."

and I still want it to read through the “.

  • 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-04T18:00:29+00:00Added an answer on June 4, 2026 at 6:00 pm

    What you’re describing sounds like a single-column CSV file. The easiest way to access that is probably to use the Microsoft.VisualBasic.FileIO.TextFieldParser class, something like:

    using (var csvParser = new TextFieldParser(new StringReader(content))
                                 {
                                     Delimiters = new[] {","},
                                     HasFieldsEnclosedInQuotes = true
                                 })
    {
        while (!csvParser.EndOfData)
        {
            var fields = csvParser.ReadFields();
            Console.Print(fields[0]); //do something with the first (in your case only) field found.
        }
    }
    

    Probably the easiest way to determine whether this approach makes sense, is to think about what happens if the string you’re reading actually contains a double quote. Would it end up as "He said ""this is quoted"", but I wasn't listening" (doubling up the quotes), or is this situation impossible?

    If the quotes would be doubled up in this way, then a standard CSV reader like this built-in framework one is probably your best bet.

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

Sidebar

Related Questions

I need to read data from a text file where the field lengths and
I need to archive data from a CRM system. Does anyone have any idea
I've got a compiled resource file (.res). I need to read it, in C#,
I need to write a simple terminal-based program that should, Read some text from
I need a plain text representation of an arbitrary HTML file (e.g., a blog
A simulation program I'm using requires a text based input file. I need to
I need a idea in inserting images and hyper link buttons inside a callout
I just need a general idea. I'm developing a sports application in django. This
basically need to change the value that - admin_url() returns any idea?
i need to convert this query to C# LINQ but i have no idea

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.