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

  • Home
  • SEARCH
  • 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 7859847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:03:14+00:00 2026-06-02T22:03:14+00:00

I need it help with shell script, python script or anything that can do

  • 0

I need it help with shell script, python script or anything that can do this. I want to create a script that can parse the following information from a “txt” file to csv. Info I need to parse for my online grade book is to take the username and the lab score. The lab score can be found on this line

Your score for this lab: 20/20

and the username can be found on this line

Student: username0

Thank you for reading and helping me!

Here is the example of the file test.txt

Student: username0

Your score for this lab: 20/20

Score Breakdown:
info...

Part 1:


Part 2:


Part 3:

------------------------------------------------
------------------------------------------------
------------------------------------------------
Student: username1

Your score for this lab: 20/20

Score Breakdown:
info...


Part 1:


Part 2:


Part 3:

------------------------------------------------
------------------------------------------------
------------------------------------------------
Student: username2

Your score for this lab: 20/20

Score Breakdown:



Part 1:


Part 2:


Part 3:

------------------------------------------------
------------------------------------------------
------------------------------------------------
  • 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-02T22:03:16+00:00Added an answer on June 2, 2026 at 10:03 pm

    Bah, this is so easy to do in Python, why not share it with you?

    def filtered(lines):
        for line in lines:
            if line.startswith('Student:') or line.startswith('Your score for this lab:'):
                yield line.rstrip().split()[-1]
    
    with open('test.txt', 'r') as f:
        for student, score in zip(*[filtered(f)]*2):
            print(student, score)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need help writing a script downloads data from google insight using c# this is
i need some help with a shell script. I want to start a shell
I need some help from the shell-script gurus out there. I have a .txt
I am new to this shell-script programming so need your help to write a
I need help finishing this statement. It is frustrating that two of the PHP
I need help to write a shell script to calculate the directory space in
I have the following shell script that echos output to the log and errors
I need a very simple shell script that processes all images on a folder
I need to download videos from youtube using a python script. However i am
I am new to shell scripting and I need some help on the following

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.