Announcement

Collapse
No announcement yet.

[Utility] DB<->CSV 1.3

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Utility] DB<->CSV 1.3

    This is, hopefully, the final version. This program can convert many of CTP2's Database file to CSV format and back.

    Readme:
    DB<->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:

    Code:
    ENTRY_NAME_1 {
    	flag_1
    	.
    	.
    	.
    	flag_n
    	
    	INNER_ENTRY_1 {
    		flag_1
    		.
    		.
    		.
    		flag_n
    	}
    	.
    	.
    	.
    	INNER_ENTRY_N {
    		flag_1
    		.
    		.
    		.
    		flag_n
    	}
    }
    where flags are a 1 or 2 word entry.

    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.
    Download here: http://apolyton.net/directory/jump/c-utilities-54/5360
    Last edited by Martin Gühmann; June 2, 2009, 17:56.
    "

  • #2
    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.
    "

    Comment


    • #3
      So this thread is now about version 1.3. Title fixed.

      -Martin
      Civ2 military advisor: "No complaints, Sir!"

      Comment


      • #4
        Thankyou.

        I should also note that I fixed a glitch where it didn't recognize tabs as whitespaces, resulting in a few missing entries.
        "

        Comment


        • #5
          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.
          "

          Comment


          • #6
            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.
            Attached Files
            "

            Comment


            • #7
              Preview of DBEditor
              Attached Files
              "

              Comment


              • #8
                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.

                Comment


                • #9
                  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.
                  "

                  Comment


                  • #10
                    Originally posted by EPW View Post
                    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.

                    I won't know what (if anything) is missing until I've tried it. Is it fully keyboard based? (not complaining).
                    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.

                    Comment


                    • #11
                      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.

                      Comment


                      • #12
                        Ah yes, uniticons.txt. Probably the most infamous ctp2 [db] file.
                        "

                        Comment


                        • #13
                          Originally posted by Maquiladora View Post
                          Is it fully keyboard based? (not complaining).
                          yeah keyboard only
                          "

                          Comment


                          • #14
                            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).

                            Comment


                            • #15
                              could you make it as expansive as ctped?

                              Comment

                              Working...
                              X