> For the complete documentation index, see [llms.txt](https://docs.os.uk/os-downloads/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.os.uk/os-downloads/products/addresses-and-names-portfolio/os-open-names/os-open-names-getting-started-guide/csv-file-processing.md).

# CSV file processing

As OS Open Names data is supplied in separate CSV files labelled by two-digit grid references, the files require processing before you can load them into a GIS.

## Moving the header CSV file <a href="#id-3.1-moving-the-header-csv-file" id="id-3.1-moving-the-header-csv-file"></a>

The first step is to combine the individual CSV files with the header CSV file available on the [OS Open Names download page](/os-downloads/products/addresses-and-names-portfolio/os-open-names/os-open-names-downloads.md). To move and rename the header CSV file:

1. Extract *opname\_csv\_gb.zip* to a folder on your computer.
2. Open the Doc folder and either move or copy *OS\_Open\_Names\_Header.csv* into the Data folder.
3. Rename *OS\_Open\_Names\_Header.csv* to *a\_OS\_Open\_Names\_Header.csv*.

*Adding the “a\_” prefix ensures that the files will be merged in the correct order. The header file will be added first in the output file as it is now at the top of the file list.*

<figure><img src="/files/Ka2dqWmJuajWhxDU6j7A" alt="Screenshot in Windows Explorer showing renamed header CSV file (a_OS_Open_Names_Header.csv) displayed at the top of the file list." width="246"><figcaption><p>Screenshot in Windows Explorer showing renamed header CSV displayed at the top of the file list.</p></figcaption></figure>

## Combining multiple CSV files <a href="#id-3.2-combining-multiple-csv-files" id="id-3.2-combining-multiple-csv-files"></a>

This section contains an example of one way to combine the individual CSV files into a single file using a batch (.bat) file.

{% hint style="info" %}
*The combined CSV file will be approximately 1.7Gb with about 2.9 million records. If opened in Microsoft Excel, only the first million records can be seen as the software cannot display more than this.*
{% endhint %}

To combine the CSV files using a batch function:

1. Copy the following text and paste it into a new Notepad file: *copy \*.csv outputfile.csv*.
2. Save the Notepad file with the .bat file extension (for example, *combine\_csv.bat*) in the Data folder that contains the 819 CSV files.
3. Close the .bat file, navigate to the Data folder and double click on the batch (.bat) file that you saved in the previous step.

*A MS-DOS window will open automatically and then close when the process is complete.*

4. A new CSV file named *outputfile.csv* will display in the Data folder. You can now delete the other CSV files if you like.

*outputfile.csv contains the content previously in the 819 individual CSV files that was copied over during the batch file process.*

<figure><img src="/files/zDf2fYMnBmv0zfR0rzgp" alt="Screenshot in Windows Explorer showing outputfile.csv and combine_csv.bat."><figcaption><p>Screenshot in Windows Explorer showing <em>outputfile.csv</em> and <em>combine_csv.bat</em></p></figcaption></figure>

You will now have an output file that is ready to be used in a GIS application or database.

{% hint style="danger" %}
*outputfile.csv might be too large to be opened in a text editor such as Excel.*
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.os.uk/os-downloads/products/addresses-and-names-portfolio/os-open-names/os-open-names-getting-started-guide/csv-file-processing.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
