v1.3 Released!
Flags in the database file but not present in the .cfg file will be printed to the screen.
Updated all the .cfg files.

This is, hopefully, the final version. This program can convert many of CTP2's Database file to CSV format and back.
Readme:
Download here: http://apolyton.net/directory/jump/c-utilities-54/5360DB<->CSV is a tool used to convert many of Call to Power II's database files into comma-deliminated
format(CSV) and back again. Viewing a database file in CSV format with a spreadsheet program allows you to
easily compare the entries and make changes. When converting a database file to CSV format, the program
loads an associated configuration file that contains all the flags associated with that database file.
Only database files with the format outlined below will work with this program:
where flags are a 1 or 2 word entry.Code:ENTRY_NAME_1 { flag_1 . . . flag_n INNER_ENTRY_1 { flag_1 . . . flag_n } . . . INNER_ENTRY_N { flag_1 . . . flag_n } }
This version of the program comes with three configuration files:
Units.txt
Advance.txt
buildings.txt
Supported Database Files without a Configuration file:
govern.txt
goods.txt
feat.txt
order.txt
pop.txt
risks.txt
terrain.txt
tileimp.txt
wonders.txt
Use:
You first must specify the .txt, .csv, and .cfg file you want to use in the csv.cfg file. If one of the
files does not exist, this is the name it will be given when it is created.
Run the DBCSV.exe file in the same folder as the file you want to convert, and the necessary cfg files.
Option 1 will convert a database file into csv format, and option 2 will convert a csv file back into a
database file.
The CSV file
You should be able to open the CSV file with any spreadsheet program. Entries appear in the order they are
listed in the configuration file. Flags appear along the top row and associated entries appear below it. A
"Yes" means its a flag with no associated value. A "No" means this flag does not appear in this entry. The
conversion from csv to the txt file is dependent on the flags listed in the first row of the csv file.
Therefore, You can add or remove flags all together from the csv file. When adding a flag, each entry
needs a value. Do not leave any cell blank.
Configuration file format
You can edit existing Configuration files or create a new one. Add flags at the beginning of a new line.
If a flag can appear multiple times, you'll need to add the flag to the file multiple times as well. The
program only grabs entrees that are listed in the config file: ALL OTHER ENTRIES ARE LOST IN THE
CONVERSION. If a flag appears 3 times in a particular entry, but its only listed two times in the config
file, the third entry WILL BE LOST.
All entries in the config file must have an associated tag listed next to it.
s - An s means this flag has a second word listed after it in the DB file
t - A t means this flag appears alone (no second word)
a - An a means this is the name of of an inner entry (an ability in the Units.txt file)
as - These are flags that appear in an inner entry, and have a second word listed after it.
at - These are flags that appear in an inner entry that do not have a second word listed after it.
Last edited by Martin Gühmann; June 2, 2009 at 17:56.

v1.3 Released!
Flags in the database file but not present in the .cfg file will be printed to the screen.
Updated all the .cfg files.

So this thread is now about version 1.3. Title fixed.
-Martin
Civ2 military advisor: "No complaints, Sir!"

Thankyou.
I should also note that I fixed a glitch where it didn't recognize tabs as whitespaces, resulting in a few missing entries.![]()

I'm working on expanding this to include the gl_str.txt files. It will hopefully produce a separate csv file which will list the languages along the top and the associated entries below it.

Progress so far. I've finished the conversion to csv, though there are some peculiarities to work out. Then on to converting it back, which should be a doozy.

Preview of DBEditor

Looking good![]()
Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
CtP2 AE Wiki & Modding Reference
One way to compile the CtP2 Source Code.

This is the time to recommend additional features. My goals for the first release are to load allow it to load the DB files, gl_str files, and the Great Library files and allow you to edited it all at once. I'll also keep the CVS conversion of course, and it won't need the annoying config file.

Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
CtP2 AE Wiki & Modding Reference
One way to compile the CtP2 Source Code.
This looks very ambitious, like a replacement of CTPEd. I can't think of a "features request" for the moment. Good support for the strings database, specifically the great library in conjunction with uniticon.txt, would of course be extremely helpful.
The modding knowledgebase: CTP2 Bureau (with CTP2 AE Modding Wiki). Modern Times Mod (work in progress): MoT-Mod for CTP2.

Ah yes, uniticons.txt. Probably the most infamous ctp2 [db] file.

when I use this software and create an advance.txt. I get notifications that it's expecting #'s at certain locations, and if I want to continue loading. I say yes, and it tells me the next line it's expecting a #. I noticed that it pads a lot of extra info into the advance file than the original (I'm not talking comments either).

could you make it as expansive as ctped?

Oh, did you modify contents of the csv.cfg file to:
TextFile=Advance.txt
CFGFile=Advance.cfg
CSVFile=Advance.csv
Name=Advance
I was dumb to make the file extension ".cfg" when I made the program(thought I was being clever and all), but you can modify the file with any text editor.

yes I did. At first it was units, but then I made it look just like you have it.

I'm actually making some progress on the edit program; I may release it at some point.

probably a little late for this, but I cant convert the standard advance.txt back and forth again, it crashes when it tries to convert it back to a .csv file every time. It just creates an empty .txt file.
using 1.3
I'm not getting any more issues with #commented entries throwing any issues. I'm able to generate a .csv file, just not back to a .txt.
Last edited by thistleknot; May 14, 2013 at 05:23.
Bookmarks