Search code examples
csvfilewekadata-mining

How do I fix this "wrong number of values" error when opening CSV file in Weka?


I am taking a Data Mining course and for an upcoming assignment I have to do some clustering with the bank-full.csv dataset found here in the bank zip file https://archive.ics.uci.edu/ml/machine-learning-databases/00222/ but I am having trouble opening it in Weka. I get the following error: "wrong number of values: Read 11, expected 17, read Token[EOL], line 2 Problem encountered on line: 2". I have looked at the file in excel and cannot figure out what seems to be the problem, how can I fix this? What is causing this error?


Solution

  • Yes, bank.csv produced the same error for me.

    The file looks fine to me, also.

    But there's a workaround. I opened bank.csv in Excel, did Data -> Text to Columns with a semicolon delimiter. This looked just fine also, with all the data lined up in the right columns. I then saved this as a .csv file, e.g. bank2.csv. Loaded this file fine.