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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:51:54+00:00 2026-06-01T19:51:54+00:00

I have a package with a GUI, and in this GUI I need to

  • 0

I have a package with a GUI, and in this GUI I need to read a text file (call it list.txt) that may look like

8:00am something

9:00am somethingelse

1:00pm something different

With each time/event on a separate line.

How do I read each line separately and extract the time portion from each line? What I need to accomplish is to compare times in a list like this to a range of times I have previously determined, and reprint the list with only events/times in that range, but I’m not sure on how to read it line by line.

How does the question not make sense? All I am asking is how to take a textFile (one written in a separate java package) and how to basically read it one line at a time and take the time portion from each line. The time is always at the start of each line. I’m sorry, but I don’t know how to be more clear on that, that is about all there is to it.

And The user provides the text file name via GUI application, as well as a time range. But that part I have down.

  • 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-01T19:51:56+00:00Added an answer on June 1, 2026 at 7:51 pm
    • Use java.io.BufferedReader‘s readLine() method to read file line-by-line.
    • Use java.lang.String‘s indexOf() method to locate the first space.
    • Use java.lang.String‘s substring() method to extract before and after the space.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a canonical file structure like that (I'm giving sensible names to ease
I have a thread like this public class SMS { class Read implements Runnable
I have a package with logic classes(like CheckAuthenticationDataLogic.java, GetVocabulariesLogic.java). And another class - ApiService.java
I have one package contains many Stored Procedure for populating diffrent tables. This package
I have an SSIS package that queries data from a view using an SQL
I have a Util package with source files in three seperate directories, defined like
I have an ArrayList that needs to be read from and written to from
Problem: I'd like to specify the main class in a jar file that I
I have a dtsx package with a precedence constraint that evaluates an expression and
I have this simple activity which suppose to change the text of TextView once

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.