Results 1 to 20 of 20

Thread: [Utility] DB<->CSV 1.3

  1. #1
    EPW
    Emperor EPW's Avatar
    Join Date
    10 Jan 2004
    Location
    ??
    Posts
    3,887
    Country
    This is EPW's Country Flag
    Thanks
    1
    Thanked 1 Time in 1 Post
    Local Date
    May 20, 2013
    Local Time
    09:20

    [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 at 17:56.

  2. #2
    EPW
    Emperor EPW's Avatar
    Join Date
    10 Jan 2004
    Location
    ??
    Posts
    3,887
    Country
    This is EPW's Country Flag
    Thanks
    1
    Thanked 1 Time in 1 Post
    Local Date
    May 20, 2013
    Local Time
    09:20
    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.

  3. #3
    Martin Gühmann
    Administrator Martin Gühmann's Avatar
    Join Date
    02 Mar 2001
    Location
    Tübingen, Germany
    Posts
    7,246
    Country
    This is Martin Gühmann's Country Flag
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Local Date
    May 20, 2013
    Local Time
    18:20

    Post

    So this thread is now about version 1.3. Title fixed.

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

  4. #4
    EPW
    Emperor EPW's Avatar
    Join Date
    10 Jan 2004
    Location
    ??
    Posts
    3,887
    Country
    This is EPW's Country Flag
    Thanks
    1
    Thanked 1 Time in 1 Post
    Local Date
    May 20, 2013
    Local Time
    09:20
    Thankyou.

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

  5. #5
    EPW
    Emperor EPW's Avatar
    Join Date
    10 Jan 2004
    Location
    ??
    Posts
    3,887
    Country
    This is EPW's Country Flag
    Thanks
    1
    Thanked 1 Time in 1 Post
    Local Date
    May 20, 2013
    Local Time
    09:20
    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.

  6. #6
    EPW
    Emperor EPW's Avatar
    Join Date
    10 Jan 2004
    Location
    ??
    Posts
    3,887
    Country
    This is EPW's Country Flag
    Thanks
    1
    Thanked 1 Time in 1 Post
    Local Date
    May 20, 2013
    Local Time
    09:20
    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 Images Attached Images

  7. #7
    EPW
    Emperor EPW's Avatar
    Join Date
    10 Jan 2004
    Location
    ??
    Posts
    3,887
    Country
    This is EPW's Country Flag
    Thanks
    1
    Thanked 1 Time in 1 Post
    Local Date
    May 20, 2013
    Local Time
    09:20
    Preview of DBEditor
    Attached Images Attached Images

  8. #8
    Maquiladora
    Emperor
    Join Date
    17 Jun 2001
    Posts
    7,714
    Country
    This is Maquiladora's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    17:20
    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.

  9. #9
    EPW
    Emperor EPW's Avatar
    Join Date
    10 Jan 2004
    Location
    ??
    Posts
    3,887
    Country
    This is EPW's Country Flag
    Thanks
    1
    Thanked 1 Time in 1 Post
    Local Date
    May 20, 2013
    Local Time
    09:20
    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.

  10. #10
    Maquiladora
    Emperor
    Join Date
    17 Jun 2001
    Posts
    7,714
    Country
    This is Maquiladora's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    17:20
    Quote 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.

  11. #11
    BureauBert
    Senior Staff BureauBert's Avatar
    Join Date
    13 Apr 2003
    Location
    Vienna, proud home of bureaucracy
    Posts
    297
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    18:20
    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.

  12. #12
    EPW
    Emperor EPW's Avatar
    Join Date
    10 Jan 2004
    Location
    ??
    Posts
    3,887
    Country
    This is EPW's Country Flag
    Thanks
    1
    Thanked 1 Time in 1 Post
    Local Date
    May 20, 2013
    Local Time
    09:20
    Ah yes, uniticons.txt. Probably the most infamous ctp2 [db] file.

  13. #13
    EPW
    Emperor EPW's Avatar
    Join Date
    10 Jan 2004
    Location
    ??
    Posts
    3,887
    Country
    This is EPW's Country Flag
    Thanks
    1
    Thanked 1 Time in 1 Post
    Local Date
    May 20, 2013
    Local Time
    09:20
    Quote Originally Posted by Maquiladora View Post
    Is it fully keyboard based? (not complaining).
    yeah keyboard only

  14. #14
    thistleknot
    Warlord
    Join Date
    09 Nov 2009
    Location
    Long Beach
    Posts
    113
    Country
    This is thistleknot's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    09:20
    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).

  15. #15
    thistleknot
    Warlord
    Join Date
    09 Nov 2009
    Location
    Long Beach
    Posts
    113
    Country
    This is thistleknot's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    09:20
    could you make it as expansive as ctped?

  16. #16
    EPW
    Emperor EPW's Avatar
    Join Date
    10 Jan 2004
    Location
    ??
    Posts
    3,887
    Country
    This is EPW's Country Flag
    Thanks
    1
    Thanked 1 Time in 1 Post
    Local Date
    May 20, 2013
    Local Time
    09:20
    Quote Originally Posted by thistleknot View Post
    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).
    I don't remember it asking about #'s; though it will add a single comment to each advance, which just says "Advance X" or some such thing.

    I am still working on the ctped program.

  17. #17
    EPW
    Emperor EPW's Avatar
    Join Date
    10 Jan 2004
    Location
    ??
    Posts
    3,887
    Country
    This is EPW's Country Flag
    Thanks
    1
    Thanked 1 Time in 1 Post
    Local Date
    May 20, 2013
    Local Time
    09:20
    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.

  18. #18
    thistleknot
    Warlord
    Join Date
    09 Nov 2009
    Location
    Long Beach
    Posts
    113
    Country
    This is thistleknot's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    09:20
    yes I did. At first it was units, but then I made it look just like you have it.

  19. #19
    EPW
    Emperor EPW's Avatar
    Join Date
    10 Jan 2004
    Location
    ??
    Posts
    3,887
    Country
    This is EPW's Country Flag
    Thanks
    1
    Thanked 1 Time in 1 Post
    Local Date
    May 20, 2013
    Local Time
    09:20
    I'm actually making some progress on the edit program; I may release it at some point.

  20. #20
    thistleknot
    Warlord
    Join Date
    09 Nov 2009
    Location
    Long Beach
    Posts
    113
    Country
    This is thistleknot's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    May 20, 2013
    Local Time
    09:20
    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.

Similar Threads

  1. ODA RoN Mod Utility
    By One_Dead_Villy in forum Rise of Nations
    Replies: 2
    Last Post: February 7, 2007, 21:10
  2. Where's That Utility...
    By Patine in forum Civilization I and Civilization II
    Replies: 4
    Last Post: February 6, 2006, 12:12
  3. UTILITY: Map Making Utility and Save Viewer
    By LookANinja in forum Civilization III
    Replies: 103
    Last Post: March 14, 2004, 01:57
  4. UTILITY: Civ3Peek - SPYING UTILITY
    By CTyson in forum Civilization III
    Replies: 7
    Last Post: August 4, 2002, 04:02
  5. Does anyone know of a utility that can.........
    By Dracon in forum Scenario League / Civ2-Creation -Archive
    Replies: 2
    Last Post: February 12, 2000, 02:35

Visitors found this page by searching for:

dbcsv.exe

epw to csvconverting csv to epwcsv 1.3country flags .csvhow to convert csv to civciv5 proper format for csvconvert cvs in epwutility dbpowered by vBulletin utility softwarecountry flags csv filedatabase access by c programdb_editor.jpgpowered by vBulletin utilityciv 4 wonders csvsoftware to convert db file to csv or txt file

Bookmarks

Posting Permissions