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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:37:56+00:00 2026-06-03T05:37:56+00:00

I am trying to automate some Weka classification using Java code. I’m getting the

  • 0

I am trying to automate some Weka classification using Java code. I’m getting the following error when I try to read my csv file:

java.io.IOException: wrong number of values. Read 98, expected 97,
read Token[EOL], line 3 at
weka.core.converters.ConverterUtils.errms(ConverterUtils.java:912) at
weka.core.converters.CSVLoader.getInstance(CSVLoader.java:747) at
weka.core.converters.CSVLoader.getDataSet(CSVLoader.java:570) at
Classifier_Search.readFile(Classifier_Search.java:18) at
Classifier_Search.main(Classifier_Search.java:178) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
edu.rice.cs.drjava.model.compiler.JavacCompiler.runCommand(JavacCompiler.java:271)

I get the same error when I try to feed the csv file in through the Weka GUI. As far as I know, the csv file is no different from other csv files that I’ve successfully used with Weka. Any thoughts about what could be causing this error?

I haven’t been able to find a satisfactory answer on OldNabble for this – I’ve tried the one suggestion that I managed to find and it did not work. The one suggestion was to encapsulate the entries in double quotes – that did not change anything.

Just for clarity (and because I don’t know how to upload things), the csv files look like this:

C1V1, C2V1, C3V1, … Class,

4000.5, 3890.6, 2900.7, … N,

…

…

There are 97 entries per row. In another version, I have double quotes around the strings and chars (in the first row and last column) and, as I previously stated, that doesn’t help.

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-03T05:37:58+00:00Added an answer on June 3, 2026 at 5:37 am

    I’ve discovered the difference: if there is a comma at the end of a line in a .csv file, it causes csvloader to throw this error. So, if you’re trying to use this, eliminate the commas at the ends of lines in your .csv file. I don’t know why only line 3 and not lines 1 and 2 threw the error (all lines were identical), but this fixed it.

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

Sidebar

Related Questions

I'm trying to automate some command line tests on Windows and Unix. I'm using
I'm trying to automate some processes using Robot and it seems certain keycodes (only
I'm trying to automate some stuff in MS Excel. When I try to set
I'm trying to automate the download of some data from a webform. I'm using
I'm trying to find a way to automate some exception logging code to add
I am trying to automate some authentication where I connect via RDP, and authenticate
I'm trying to automate the build of a project in Delphi 2009. I'm using
I am trying to automate a web application having javascript. I am using WWW::Scripter
I'm trying to automate a tedious problem. I get large Excel (.xls or .csv,
I am trying to automate some email when our company is done with an

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.