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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:17:17+00:00 2026-06-12T09:17:17+00:00

Imagine a text file something like the following: Case 4 case 4.1 a 3

  • 0

Imagine a text file something like the following:

Case 4
case 4.1
a 3
a 5
a 7
a 1
a 9
a 4
endcase 4.1
//
.
.
. Do things that dont get parsed
.
.
//
case 4.2
a 1
b 3
a 6
b7 
endcase 4.2
endcase 4
//
.
.
.
. More things
.
.
//
case 5
.
.
.
.
endcase 5

which contains the values of multiple variables at different points in time. Eg, case 4 concerns variable a and b. How do I extract only the lines between say case 4.1 and endcase 4.1?

  • 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-12T09:17:18+00:00Added an answer on June 12, 2026 at 9:17 am

    You can use awk, for example:

    awk '/^case 4.1/,/^endcase 4.1/' ./your_file
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine you have two views with code like the following: controller_a/a.html.erb <%= content_tag(:div) do
Imagine this simple form for uploading a file: <form action=upload enctype=multipart/form-data> <input type=text name=name/>
I need to generate windows form fields based off of a text file that
Imagine that I have a C# application that edits text files. The technique employed
I have a text file that I need to retrieve to populate a web
Imagine a table with the following structure on PostgreSQL 9.0: create table raw_fact_table (text
Imagine a text file of 20 mb. I am reading char by char and
Imagine a json file with the following data: [ { color: red, value: #f00
Suppose you have a text file like: my_setting = ON some_method = METHOD_A verbosity
Imagine a scenario you have a text file with say 10000 rows in it

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.