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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:50:44+00:00 2026-05-16T17:50:44+00:00

For my data structures class, the first project requires a text file of songs

  • 0

For my data structures class, the first project requires a text file of songs to be parsed.

An example of input is:
ARTIST=”unknown”
TITLE=”Rockabye Baby”
LYRICS=”Rockabye baby in the treetops
When the wind blows your cradle will rock
When the bow breaks your cradle will fall
Down will come baby cradle and all
“

I’m wondering the best way to extract the Artist, Title and Lyrics to their respective string fields in a Song class. My first reaction was to use a Scanner, take in the first character, and based on the letter, use skip() to advance the required characters and read the text between the quotation marks.

If I use this, I’m losing out on buffering the input. The full song text file has over 422K lines of text. Can the Scanner handle this even without buffering?

  • 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-16T17:50:44+00:00Added an answer on May 16, 2026 at 5:50 pm

    For something like this, you should probably just use Regular Expressions. The Matcher class supports buffered input.

    The find method takes an offset, so you can just parse them at each offset.

    http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Matcher.html

    Regex is a whole world into itself. If you’ve never used them before, start here http://download.oracle.com/javase/tutorial/essential/regex/ and be prepared. The effort is so very worth the time required.

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

Sidebar

Related Questions

We were just assigned a new project in my data structures class -- Generating
I'm working on a project about Data structures. In the first , I wrote
The class project has us reading in the title, artist and lyrics of 10,514
I took a data structures class in C++ last year, and consequently implemented all
Let's say I have data structures that're something like this: Public Class AttendenceRecord Public
I want to implement in Java a class for handling graph data structures. I
For my project I wrote a small config class that loads its data from
The assignment, for my data structures class, is to find the shortest path from
I currently am using a data structures similar to the following: public class Individual
I have a data structure that represents C# code like this: class Namespace: string

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.