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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:55:53+00:00 2026-06-07T17:55:53+00:00

To read file into a list, create a new class called ListUtils and write

  • 0

To read file into a list, create a new class called ListUtils and write a method called
public static ListElement readMP3List(String fileName) throws IOException
which will take the name of the file to be read and return the head of a linked list containing the the objects that the file.
In readMP3List, you should open fileName using the classes java.io.BufferedReader and java.io.FileReader and read one line at a time. Each line you should break apart into its fileName, artist, etc., and then use these values to populate a new MP3Info object. Then you make a new ListElement object containing the MP3Info object you just made and put it onto your list.

So far I’ve got:

public class ListUtils{

    public static ListElement readMP3List(String fileName) throws IOExeption{
    {
            // takes name of file  to be read
            // returns the head of Linkedlist
            File file = new File("random_sample.tsv");
            BufferedReader br = new BufferedReader(new FileReader(file));
            String first= br.readLine();
    }

The file has multiple lines of names,artist,etc in which I have to split to. I’m really confused on how to use the split(regex) in order to accomplish this.

An example of the file is this:
fileName artist songName album trackNum numSeconds year genre \n

  • 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-07T17:55:55+00:00Added an answer on June 7, 2026 at 5:55 pm

    I think this is what you need:

    String fist=  "fileName artist songName album trackNum numSeconds";
    
    String[] data = fist.split(" ");//whitespace if tab replace with "\t"
    
    String fileName = data[0];
    String artist = data[1];
    String songName = data[2];
    String album = data[3];
    String trackNum = data[4];
    String numSeconds = data[4];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to read lines from a file into a Set or List. Is
I have read a file into a String. The file contains various names, one
I am using Apache Commons IO FileUtils utility to read a file into a
In Java, I just read a file into a ByteBuffer. When I started checking
I'd like to read an MSI file into a MemoryStream (or something similar), and
I need to read a whole file into memory and place it in a
I'm trying to read a .wav file into an array of bytes to be
I'm trying to read a csv file into R that has date values in
Is there a way to directly read a binary file into RAM? What I
That there is no simple way to read a PNG file into a memory

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.