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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:20:34+00:00 2026-06-06T18:20:34+00:00

So far, I have 2 arrays: one with stock codes and one with a

  • 0

So far, I have 2 arrays: one with stock codes and one with a list of file names. What I want to do is input the .txt files from each of the file names from the second array and then split this input into: 1. Arrays for each file 2. Arrays for each part with each file.

I have this:

            ImportFiles f1 = new ImportFiles("File"); 
    for (String file : FileArray.filearray) { 
        if (debug) {
            System.out.println(file);
        }
        try { 
            String line;
            String fileext = "C:\\ASCIIpdbSKJ\\"+file+".txt";
            importstart = new BufferedReader(new FileReader(fileext));
            for (line = importstart.readLine(); line != null; line = importstart.readLine()) {
                importarray.add (line);
                if (debug){
                    System.out.println(importarray.size());
                }
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

        importarray.add ("End")

This approach works to create a large array of all the files, will it be easier to change the input method to split it as it is coming in or split the large array I have?

At this point, the stock code array is irrelevant. Once I have split the arrays down I know where I will go from there.

Thanks.

Edit: I am aware that this code is incomplete in terms of { } but it is only printstreams and debugging missed off.

  • 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-06T18:20:36+00:00Added an answer on June 6, 2026 at 6:20 pm

    If you want to get a map with a filename and all its lines from all the files, here are relevant code parts:

    Map<String, List<String>> fileLines = new HashMap<String, List<String>>();
    for (String file : FileArray.filearray)
        BufferedReader reader = new BufferedReader(new FileReader(fileext));
    
        List<String> lines = new ArrayList<String>();
        while ((line = reader.readLine()) != null){
            lines.add(line);
        }
    
        fileLines.put(file, lines);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been given an assignment to read mock processes from a txt file
Hi I have a text file containing two arrays and one value(all integers) like
I have four arrays of data (3072 bytes each.) I want to point to
So far I have only been updated a view from within its controller. I
So far i have an assembly script that lets you boot from it and
I have 2 one dimensional arrays, containing the exact same values: public int[] start
I am coding some program that among many other operations have one that from
I'm a new user to knockout.js and so far have been very impressed with
So far I have the expression: http://[^\.]*\.mydomain\.com/((.*?)) Which matches... http://www.mydomain.com/Images/favicon.ico But I really dont
So far I have been creating Web Portal but recently I had a request

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.