Editing CSV Files
This article is part of our OOTP Documentation series.
- General Game Information
- User Interface
- Getting Started
- Creating Games
- Screen Descriptions by Menu
- Game Concepts
- Playing OOTP
- Online Leagues
- Customization and Mods
Many of the customizable files used in OOTPB are comma-separated (or comma-delimited) files. These are simple text files. They can be edited with just about any program that can read text files, including most word processing programs, Notepad, or Write, for example.
In OOTP's comma-separated text files, each row represents a single thing, such as a name or an injury in OOTP. Each row holds multiple pieces of information about that one thing. These pieces of information (or 'values') are separated by commas. Hence, 'comma-separated,' because commas separate the pieces of data.
For example, in the OOTP names files, we track three pieces of data for each name: the name, the frequency, and the name set ID. These pieces of data are separated by commas. So, the first names file begins with two lines like this:
Since the commas represent divisions between different pieces of information, we could describe these two lines in plain English in the following way:
The first name 'A.C.' has a frequency of 1, and belongs to name set ID 0.
The first name 'A.J.' has a frequency of 1, and belongs to name set ID 0.
Most of OOTP's text files are comma-separated, and behave in a similar fashion.
Using CSV Files to Edit
These files have the .txt extension, but in reality they are comma-separated value (.csv) files in disguise. Editing large quantities of data is far easier in a .csv format than it is with a .txt extension. Converting one of OOTP's comma-separated text files to a .csv extension for mass editing in a spreadsheet program is simple to do.
- Open the text file you wish to edit.
- Save a copy (or backup) of the text file.
- Use the save as function to save the file with a .csv extension.
- Open the newly-saved .csv file with your favorite spreadsheet program, such as Microsoft Excel.
- Make changes within the spreadsheet program.
- Save the spreadsheet, clicking 'OK' or 'Yes' to the pop-up dialogues.
- Open the recently-saved .csv file with a text editor, such as Notepad.
- Save the open file as a .txt file.