Skip to main content

Import Barclays.net multi-account bank statements into your Client Accounts

How to convert the Barclays.net Account Statement Report into a CSV you can import via CSV mapping, using Claude to run a conversion script.

If you bank with Barclays.net and use their multi-account statement export, your file needs a quick conversion before you can import it via CSV mapping. This article walks you through converting the file using Claude, then importing it into Re-Leased.

This process applies to UK customers using Client Accounts, with the Barclays.net IPortal export (also called the Account Statement Report).

Why the extra step is needed

Barclays.net exports its multi-account statement as an Excel file with a stacked layout — each account has its own header block, and the transactions sit underneath without an account number on each row. Re-Leased's CSV mapping tool needs a flat CSV with one row per transaction and the account number repeated on every row. The steps below produce exactly that.

Before you start

You'll need:

  • Your Barclays.net Account Statement Report .xls file

  • A free Claude account at claude.ai

  • Your bank account numbers already set up in Re-Leased Client Accounts, matching the account numbers in your Barclays export exactly

Before your first run, sign in to Claude and turn on code execution:

  1. Click your initials in Claude and select Settings.

  2. Go to the Capabilities section.

  3. Toggle Code execution and file creation on.

You only need to do this once.

Step 1: Convert your Barclays export using Claude

  1. Go to claude.ai and start a new chat.

  2. Attach your Barclays export file to the chat.

  3. Copy the entire script from the Conversion script section at the bottom of this article.

  4. Paste the script into the message box, and above it, type: Run this script on the file I've attached and give me the resulting CSV to download. Install any missing packages if needed.

  5. Send the message. Claude will run the script and produce a CSV file with a download link.

  6. Download the CSV and save it somewhere you'll find it again. This is the file you'll import into Re-Leased.

Before moving on, do a quick sanity check: open your original Barclays file and note the Transaction Count shown in the summary row above each account's transactions. Add these up. The total should match the number of rows in your CSV (minus one for the header row). If it doesn't, stop and contact support.

Step 2: Import the CSV into Client Accounts

Follow the standard import process in Importing Bank Statements into Client/Trust Accounts – CSV Mapping. When you create the mapping, match your columns like this:

  • Account Number — map to the account code field

  • Bank Identifier — map to the sort code field (or your equivalent bank code field)

  • Entry Date — map to the date field (format is DD/MM/YYYY)

  • Transaction Details — map to the reference field

  • Payment Amount — map to the debit field

  • Receipt Amount — map to the credit field

  • Transaction Type — ignore (no mapping required)

  • Ledger Balance — ignore (no mapping required)

Save your mapping as something like Barclays.net multi-account so you can reuse it next time without setting it up again.

Important notes

Don't open the CSV in Excel before importing

Excel will strip the leading zeros from your account numbers — for example, 00265705 becomes 265705, and Re-Leased won't be able to match it to your Client Account. Upload the CSV to Re-Leased directly, without opening it in Excel first. If you want to inspect the file, open it in Notepad or another plain-text editor.

This works for the Account Statement report only

The script is designed for the multi-account Account Statement Report. If you use a different Barclays.net report — for example, a single-account statement or a balance report — the script won't produce the right output. Contact support if you need help with a different export format.

What data is shared with Claude

When you upload your Barclays export to Claude, the file contents — including account numbers, transaction descriptions, and amounts — are processed by Anthropic, the company that makes Claude. Before uploading, review Anthropic's privacy policy to check this is appropriate for your organisation.

On Claude's free plan, conversations may be used to improve Claude's models by default. If your organisation's data policy doesn't allow this, either upgrade to a Claude Pro plan and turn off data collection in your Claude settings, or speak to Re-Leased support about alternative options.

The script never leaves your Claude chat

The script only runs inside Claude's sandboxed environment for the length of your chat. It doesn't send your data anywhere else and doesn't save anything after the chat ends. You'll need to re-upload your file and re-run the script each time you have a new Barclays export to convert.

If something goes wrong

Contact Re-Leased support if:

  • The converted CSV is empty or has fewer transactions than the source file

  • Claude returns an error it can't resolve

  • Your import fails with account-matching errors

  • Your Barclays export looks different to the layout described here

Conversion script

Copy the entire script below (including the comments at the top) and paste it into your Claude chat along with your Barclays file:

"""
Flatten a Barclays.net multi-account "Yesterday" (Account Statement Report) .xls
export into a single flat CSV that the Re-Leased CSV mapping tool can consume.Output columns:
    Account Number, Bank Identifier, Entry Date, Transaction Details,
    Transaction Type, Payment Amount, Receipt Amount, Ledger Balance
"""import re
import sys
from pathlib import Pathimport pandas as pd# Column positions in the raw sheet. These are stable across every account block
# in the Barclays.net "Yesterday" report.
COL_LABEL_OR_DATE = 1
COL_METADATA_VALUE = 9
COL_TRANSACTION_DETAILS = 5
COL_TRANSACTION_TYPE = 11
COL_PAYMENT_AMOUNT = 17
COL_RECEIPT_AMOUNT = 24
COL_LEDGER = 30DATE_PATTERN = re.compile(r"^\d{2}/\d{2}/\d{4}$")def _clean(value):
    if value is None or (isinstance(value, float) and pd.isna(value)):
        return None
    text = str(value).strip()
    return text or Nonedef _clean_amount(value):
    if value is None or (isinstance(value, float) and pd.isna(value)):
        return None
    if isinstance(value, (int, float)):
        return f"{value:.2f}"
    text = str(value).strip().replace(",", "")
    if not text:
        return None
    try:
        return f"{float(text):.2f}"
    except ValueError:
        return textdef flatten(input_path: Path, output_path: Path) -> int:
    df = pd.read_excel(input_path, sheet_name=0, header=None)    current_account = None
    current_bank_identifier = None
    rows_out = []    for _, row in df.iterrows():
        label = _clean(row.get(COL_LABEL_OR_DATE))        if label == "Account Number / Name":
            account = _clean(row.get(COL_METADATA_VALUE))
            if account:
                current_account = account
            continue        if label == "Bank Identifier":
            bank_id = _clean(row.get(COL_METADATA_VALUE))
            if bank_id:
                current_bank_identifier = bank_id
            continue        if label and DATE_PATTERN.match(label):
            rows_out.append({
                "Account Number": current_account,
                "Bank Identifier": current_bank_identifier,
                "Entry Date": label,
                "Transaction Details": _clean(row.get(COL_TRANSACTION_DETAILS)),
                "Transaction Type": _clean(row.get(COL_TRANSACTION_TYPE)),
                "Payment Amount": _clean_amount(row.get(COL_PAYMENT_AMOUNT)),
                "Receipt Amount": _clean_amount(row.get(COL_RECEIPT_AMOUNT)),
                "Ledger Balance": _clean_amount(row.get(COL_LEDGER)),
            })    out_df = pd.DataFrame(rows_out, columns=[
        "Account Number", "Bank Identifier", "Entry Date", "Transaction Details",
        "Transaction Type", "Payment Amount", "Receipt Amount", "Ledger Balance",
    ])
    out_df.to_csv(output_path, index=False)
    return len(out_df)if __name__ == "__main__":
    input_path = Path(sys.argv[1]) if len(sys.argv) > 1 else Path("input.xls")
    output_path = input_path.with_name(input_path.stem + "_flat.csv")
    count = flatten(input_path, output_path)
    print(f"Wrote {count} transactions to {output_path}")

Trust/Client accounting terminology differs by region. UK customers see "Client Accounts", while AUS/NZ customers see "Trust Accounts". Client/Trust Accounting isn't available for North American customers. For more on regional terms, see the Glossary of Regional Terminology.

Did this answer your question?