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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:31:47+00:00 2026-06-01T17:31:47+00:00

I have a text file that has multiple blank lines and Im trying to

  • 0

I have a text file that has multiple blank lines and Im trying to return all the lines between two of them specifically

so if I have a file that looks like this:

 ____________________________
 1########################
 2##########################
 3
 4########################
 5##########################
 6#######################
 7
 8#########################
 9##########################
 10#######################
 11####################
 12########################
 13#########################
 14
 15##########################
 ----------------------------

I would like to grab lines 8-13. Unfortunately, it might not always be 8-13 as it could be 9-20 or 7-8, but it will however always be between the 2nd and 3rd line break.

I know how to trim characters and pull out singular lines, but I have no idea how to trim entire sections.

Any help would be appreciated, even if you just point me to a tutorial.

Thanks in advance.

  • 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-01T17:31:49+00:00Added an answer on June 1, 2026 at 5:31 pm

    What I ended up doing was trimming the last part and searching for what I needed in the first part (I know I didnt include the searching part in the question, but I was just trying to figure out a way to narrow down the search results as it would have had repeated results). Im posting this incase anyone else stumbles upon this looking for some answers.

    Dim applist() = System.IO.File.ReadAllLines("C:\applist.txt")
    Dim findICSName As String = "pid"
    Dim ICSName As New Regex("\:.*?\(")
    Dim x = 0
        Do Until applist(x).Contains("Total PSS by OOM adjustment:")
            If applist(x).Contains(findICSName) Then
                app = ICSName.Match(applist(x)).Value
                app = app.TrimStart(CChar(": "))
                app = app.TrimEnd(CChar("("))
                ListBox1.Items.Add(app)
            End If
            x = x + 1
        Loop
    End If
    

    How this works is that it looks through each line for the regex until it reaches first word in the breakpoint “Total PSS by OOM adjustment:”

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

Sidebar

Related Questions

I have a text file that has item numbers in it (one per line).
Scenario: I have a text file that has pipe (as in the | character)
I currently have a text file that has the following: 1 Commercial & Enterprise
I have a rather large text file that has a bunch of missing newlines,
I have a text file that I want to edit using Java. It has
I have a simple WPF (XAML) file that has some animated shapes and text.
i have a java ee project which has a text file that uses a
So I'm trying to a parse a file that has text in this format:
I have a string-array in my strings.xml file that has multiple items in it.
I have a basic PDF file that I has 5 different blank content areas

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.