All guides

The Xero report export: organisation and date-range lines above the headings, and totals in the rows

Reports exported from Xero — account transactions, aged receivables, the profit and loss — are laid out as the report is printed: the organisation name, the report title and the date range on the first lines, then the column headings, then the rows, with total rows at the end of each section. Every CSV reader takes the first line as the headings, so the file reads as junk until the lines above the real headings are gone. The editor here deletes them; the rest is one table.

What the export looks like

The first few lines hold one value each — the organisation, the report name, the period — followed by a blank line and then the headings. Within the data, an account or a contact opens a section, its transactions follow, and a Total row closes it; the aged reports carry the ageing columns as separate amounts with a total column at the right. Amounts may carry thousands separators, and negatives may be shown with a minus or in parentheses depending on the report.

The list exports — contacts, invoices, bank statement lines from a bank account — are plain tables and open cleanly everywhere. It is the report exports that need the treatment below.

Strip the title lines

Open the file in the editor here and untick "First row is headings" first — until you do, the editor takes the first line as the headings, and here that line is the organisation name. With it unticked every line is a row: delete the lines above the real headings and the blank line, leave the toggle off, and download. Nothing else changes — the editor writes back only the rows you touched, with the original quoting and line endings.

If Xero gave you an Excel workbook rather than a CSV, run it through the Excel converter first; the title block comes across in the same place and the same edit removes it.

Then the total rows

With the headings first, the total rows are the ones with no date, or whose first cell begins with Total. The filter tool keeps only the rows where the date column is filled, which drops the section headers and totals in one rule and leaves the transactions; the SQL console can then total by account itself, which is more use than Xero’s subtotals once the rows are in a table.

Amounts stay as written throughout — (1,234.56) stays as text until you choose to convert it — so nothing is silently misread.

Questions

Why does my Xero CSV open as one or two columns of junk?
Because the first line is the organisation name, not the headings. In the editor here, untick First row is headings, delete the lines above the real headings, and download; the file then reads normally.
Which rows are the totals?
The ones with no date, or whose first cell begins with Total. Keeping only rows with a date, in the filter tool here, leaves the transactions.
Will the amounts in parentheses be read as negative?
Not silently. They stay the text Xero wrote; the SQL console turns (1,234.56) into -1234.56 with one expression when you total them, and you see it happen.
Is the bank statement export the same shape?
No. Statement lines exported from a bank account in Xero are a plain table with a heading row and read cleanly. The report exports are the ones with a title block.
Can I get the file back into a workbook?
Yes. Make the edits on the CSV, then the CSV to Excel converter here writes a workbook with every value as a text cell and no title block to trip the next reader.
Is my export uploaded anywhere?
No. The organisation and date-range lines are removed in the editor on your machine; your accounts are not sent anywhere to be tidied, and the browser blocks outbound connections while you work.