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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:32:00+00:00 2026-06-04T02:32:00+00:00

this is my first post here. I’m excited to finally take part. I’m working

  • 0

this is my first post here. I’m excited to finally take part.

I’m working on a project where I’m parsing obscure files types. I need to be able to parse word (which I’ve already done), .sbs, .day, .cmp, and more. All of these types can be opened simply with notepad and displayed.

Since I’m so new to this stuff, is there a way I can use some generic library (or two) to open all of these up? And if so what library would it be?

What’s a best practice in this sort of circumstance?

Thanks!

  • 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-04T02:32:01+00:00Added an answer on June 4, 2026 at 2:32 am

    You could use the Apache Commons IO library. FileUtils class has several methods that receives the file path and optionlly the file encoding.

    If you just want to only read text files and save them to a text variable

    java.io.File file = new java.io.File("C:\\dir\\file.cmp");
    String allWordAndLines = org.apache.commons.io.FileUtils.readFileToString(file);
    

    If you want each line separately and store them in a collection:

    java.util.List<String> lines = org.apache.commons.io.FileUtils.readLines(file);
    for(String line : lines) {
        // do something with line
    }
    

    To specify the encoding, you need to add another parameter:

    org.apache.commons.io.FileUtils.readFileToString(file, "UTF-8");
    org.apache.commons.io.FileUtils.readLines(file, "Cp1252");
    

    Java include several classes for read files, see more in http://docs.oracle.com/javase/tutorial/essential/io/index.html

    I hope this can help you if you are looking for only to have your text file is available in memory.

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

Sidebar

Related Questions

This is my first post here. I have a problem. I need to take
Hello all this is my first post here i have been working in an
this is my first post here on StackOverflow and I'm quite excited about it
This is my first post here, recently i have been working with JSF2.0 with
this is my first post here on stackoverflow and am very impressed by the
My first post here, so i hope this is the right area. I am
I'm new to Java and this is my first post on here so hopefully
This is my first time here so I hope I post this question at
This is my first post here, therefore apologize for any blunders. I'm developing a
This is my first post here after many visits. Hello! I am trying to

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.