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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:45:44+00:00 2026-06-17T16:45:44+00:00

I try and write my array to a file, however instead of my data,

  • 0

I try and write my array to a file, however instead of my data, all I get is two cells; One is [Ljava.lang.String;@7b1ddcde and the other is [Lorg.supercsv.cellprocessor.ift.CellProcessor;@658fb1f7 I have no idea how on earth this is happening, as my array is actually a very nice set of data and works when I print it to the console.

My table has all of the headers and required cells, it’s just that these weird errors take up the first two cells and no other data is written.

My CellProcessor method is just full of new Optional(), so I don’t think that’s the issue here.
Here is the entire method. I am so sorry, my code is horrible it was made in a hurry.

static String[] writeWithCsvListWriter(String filename) throws Exception {
    ICsvListWriter listWriter = null;
    try {
            listWriter = new CsvListWriter(new FileWriter(Main.filename + ".csv"),
                    CsvPreference.STANDARD_PREFERENCE);

            final CellProcessor[] processors = getProcessors();
            final String[] header = new String[] { "Year", "mm", "Max Temp", "Min Temp",
                    "af days", "Rain", "Sun" };

            listWriter.writeHeader(header);

            FileReader fileReader = new FileReader(filename);
            BufferedReader bufferedReader = new BufferedReader(fileReader);
            List<String> lines = new ArrayList<String>();
            String line = null;

            int i = 0;
            while ((line = bufferedReader.readLine()) != null) {
                if(line.startsWith("   2010")){
                    try {
                        String[] splitArray = line.split("\\s+");
                        System.out.println("Writing Array");
                        listWriter.write(splitArray, processors);
                    } catch (PatternSyntaxException ex) {
                    }
                }
                i++;
            }
            bufferedReader.close();
    } finally {
            if( listWriter != null ) {
                    listWriter.close();
            }
    }
    return null;
}
  • 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-17T16:45:44+00:00Added an answer on June 17, 2026 at 4:45 pm

    Looking at the ICsvListWriter API, it looks to me like you are getting the method write(Object... columns), rather than write(List<?> columns, CellProcessor[] processors).

    The method you are trying to call appears to be expecting a List as the first argument, rather than an array, so transform your array to a list first, then attempt to write it. Something like;

    String[] splitArray = line.split("\\s+");
    List list = Arrays.asList(splitArray);
    System.out.println("Writing Array");
    listWriter.write(list, processors);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to write function that return array of string(all files and folders that
When I try to add struct in two-dimensional array cin>>array[1][items.stoka_ime]; in error list write
I got a code from here to write a Int array to file. However,
I want to read a file and write each line to array of char.
I try to write a function which returns an array of images for a
I'm outputting a byte array to a text file using the following method: try{
With following code i write an dest : array of Bytes; to a file.
I need to write a 2D numpy array to a file, including its dimensions
I want to write a byte[] data to a file and I found this
I try to write KSH script for processing a file consisting of name-value pairs,

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.