Convert xls to arff

Convert XLS to ARFF

Prepare an XLS worksheet for Weka by exporting CSV, checking attribute types, and saving ARFF.

Convert XLS files online

We don’t have a dedicated online converter for XLS to ARFF yet, but you can convert XLS files online to these and more formats:

How to convert xls to arff file

Weka commonly uses ARFF when spreadsheet data must be loaded as a machine-learning dataset with declared attributes and values. The conversion is usually triggered by preparing an Excel table for Weka Explorer, Experimenter, KnowledgeFlow, or Weka-based code.

What XLS contains

XLS is the binary Microsoft Excel 97–2003 workbook format. Microsoft Excel, LibreOffice Calc, Apache OpenOffice Calc, and business reporting systems can open or create it.

An XLS workbook can contain several worksheets, formulas, charts, formatting, merged cells, notes, hidden rows, and multiple unrelated tables. ARFF represents one data table, so isolate one rectangular range with a single header row before conversion.

Legacy XLS worksheets are limited to 65,536 rows and 256 columns. .xlsx is a different XML-based Excel format; changing an .xlsx filename to .xls does not convert it.

What ARFF contains

ARFF (Attribute-Relation File Format) is Weka's text dataset format. Its header defines a relation and attributes, followed by a @data section containing records.

ARFF can declare numeric, nominal, string, date, and relational attributes. A simple dataset might contain @relation customers, @attribute age numeric, @attribute churn {yes,no}, and then @data with comma-separated values.

Its main advantage over a spreadsheet is that the dataset schema is stored with the values. The file is plain text, can be version-controlled and inspected in a text editor, and does not retain workbook-specific presentation features.

Convert through CSV and Weka

The most dependable desktop workflow is to export the required worksheet as CSV and save it as ARFF from Weka 3.8. This avoids differences between Weka installations' Excel/Spreadsheet loader support and gives control over inferred attribute types.

  1. Open the XLS file in Excel or LibreOffice Calc. Keep one table only; remove title rows, totals, blank separator rows, comments, and repeated headings. Give every column a unique header.
  2. Recalculate formulas and save the workbook. CSV export writes displayed or cached values, not Excel formula logic.
  3. Export the relevant worksheet using File → Save As or File → Export and select CSV UTF-8 where available. Excel exports only the active worksheet; repeat the process for each required sheet.
  4. Start Weka, open Explorer → Preprocess, select Open file, and open the CSV file.
  5. Inspect every attribute. Remove non-feature columns with Filter → Choose → unsupervised → attribute → Remove. Use StringToNominal for finite categories and NumericToNominal for codes or identifiers whose numeric magnitude has no meaning.
  6. Set the target attribute in Weka's Class selector when preparing supervised data. ARFF does not store a class designation; Weka may need that selection again after reopening the file.
  7. Select Save, use a filename ending in .arff, and reopen the result to check the relation name, attribute declarations, and instance count.

Some Weka distributions provide an Excel or Spreadsheet loader that can open XLS directly. Use it only after confirming that the installed loader supports the source format and imports the intended worksheet correctly; direct import can differ by Weka version and optional libraries.

For a non-confidential one-off conversion, Convertio can be used if its current format selector offers XLS to ARFF. Inspect the downloaded file in Weka before using it, and do not upload personal, health, financial, or proprietary workbooks to third-party services.

Schema and compatibility checks

ARFF does not preserve formulas, charts, cell formatting, merged cells, comments, pivot tables, named ranges, macros, or additional worksheets. It stores values and declared attributes only.

Keep each column type consistent. A mostly numeric column containing labels such as N/A may be loaded as text, while a customer number may be treated as a numeric measurement even though it is only an identifier. Remove identifiers when possible; otherwise make them nominal or string attributes.

Use ? for missing ARFF values. Empty spreadsheet cells, N/A, and - need deliberate handling because they may become literal category values or force a text attribute.

Dates require particular care. CSV has no reliable date type, so verify that date columns have the intended ARFF declaration, such as @attribute order_date date "yyyy-MM-dd", rather than an arbitrary string or number. Values containing commas, quotes, spaces, braces, or percent signs may require ARFF quoting and escaping; saving from Weka handles this syntax.

XLS vs ARFF: format comparison

How the XLS and ARFF formats compare on the properties that matter most for this conversion.

Comparison of the XLS and ARFF file formats
Property .XLS Microsoft Excel Spreadsheet .ARFF Attribute-Relation File Format
Open standard No Partly open
Compression Both Uncompressed
Typical file size Medium Small
Opens in a web browser Partial Partial
Further editing Limited Easy
Metadata support Basic Basic
Plain-text readable No Yes
Best used for Data exchange Data exchange
Introduced 1987 —
Developer Microsoft University of Waikato / WEKA project
MIME type application/vnd.ms-excel text/arff