SQL-XML String Builder for any name table

Divine Yuri

Never Closes Chrome
Joined
Oct 28, 2014
Messages
89
Location
Brrrr, USA
This is a program I made a while back, and I'm releasing it as I feel some people might have some use for it.

Purpose:
It's purpose is it's a Java program that allows me to easily make a list of City names, Spy Names, or JFD's Head Of Government / ColonyNames. By using a file that I can easily change to suit my needs.

Which then running the program, it will create in the "Auto-Civ5Folder" folder the XML File with the Language_en_US, and SQL file with the table insert values for the list. Saving time on going back, and forth between the list on my computer and the XML Language_en_US file.

I have seen things that involved cities, but never seen something that also does it for whatever table I need no matter what the table is called. As I was working with JFD's Head Of Government, and decided making a program that did this would take me just as long as going through all 25 of the Names in Language_en_US, and save me time in the future. So I spent some time, and created this.

Requires:
Java

Output Example:
"FromFileAutoTXT.txt":
Spoiler :
Code:
Civilization_SpyNames
CivilizationType
SpyName
CIVILIZATION_DY_GENJI
TXT_KEY_SPY_NAME_
Matsuura Katai
Fujino Kichibei
Nishioka Masamichi
Kobe Takejiro
Nakagawa Tsugiharu
Watanabe Sachi
Tao Hitomaro
Ban Yajirobei
Tabata Haruhiko
Nomura Matsuta
XML:
Spoiler :
Code:
<?xml version="1.0" encoding="utf-8"?><!-- Created by AutoCity.java on Sat Jun 25 21:07:15 EDT 2016 -->
<GameData>
	<Language_en_US>
		<!--Civilization_SpyNames-->
		<!--Civilization_SpyNames : SpyName-->
		<!--Matsuura Katai-->
		<Row Tag="TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_1">
			<Text>
				Matsuura Katai
			</Text>
		</Row>
		<!--Fujino Kichibei-->
		<Row Tag="TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_2">
			<Text>
				Fujino Kichibei
			</Text>
		</Row>
		<!--Nishioka Masamichi-->
		<Row Tag="TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_3">
			<Text>
				Nishioka Masamichi
			</Text>
		</Row>
		<!--Kobe Takejiro-->
		<Row Tag="TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_4">
			<Text>
				Kobe Takejiro
			</Text>
		</Row>
		<!--Nakagawa Tsugiharu-->
		<Row Tag="TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_5">
			<Text>
				Nakagawa Tsugiharu
			</Text>
		</Row>
		<!--Watanabe Sachi-->
		<Row Tag="TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_6">
			<Text>
				Watanabe Sachi
			</Text>
		</Row>
		<!--Tao Hitomaro-->
		<Row Tag="TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_7">
			<Text>
				Tao Hitomaro
			</Text>
		</Row>
		<!--Ban Yajirobei-->
		<Row Tag="TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_8">
			<Text>
				Ban Yajirobei
			</Text>
		</Row>
		<!--Tabata Haruhiko-->
		<Row Tag="TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_9">
			<Text>
				Tabata Haruhiko
			</Text>
		</Row>
		<!--Nomura Matsuta-->
		<Row Tag="TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_10">
			<Text>
				Nomura Matsuta
			</Text>
		</Row>
	</Language_en_US>
</GameData>
SQL:
Spoiler :
Code:
-- SQL File created by AutoTXT.jar on Sat Jun 25 21:07:15 EDT 2016

INSERT INTO Civilization_SpyNames
			(CivilizationType, 				SpyName)
VALUES		('CIVILIZATION_DY_GENJI', 	'TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_1'), --Matsuura Katai
			('CIVILIZATION_DY_GENJI', 	'TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_2'), --Fujino Kichibei
			('CIVILIZATION_DY_GENJI', 	'TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_3'), --Nishioka Masamichi
			('CIVILIZATION_DY_GENJI', 	'TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_4'), --Kobe Takejiro
			('CIVILIZATION_DY_GENJI', 	'TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_5'), --Nakagawa Tsugiharu
			('CIVILIZATION_DY_GENJI', 	'TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_6'), --Watanabe Sachi
			('CIVILIZATION_DY_GENJI', 	'TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_7'), --Tao Hitomaro
			('CIVILIZATION_DY_GENJI', 	'TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_8'), --Ban Yajirobei
			('CIVILIZATION_DY_GENJI', 	'TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_9'), --Tabata Haruhiko
			('CIVILIZATION_DY_GENJI', 	'TXT_KEY_SPY_NAME_CIVILIZATION_DY_GENJI_10'); --Nomura Matsuta

How to use:
First you need to change what's in "FromFileAutoTXT.txt" - This is the file that when edited changes what the Program does. So the first 5 lines goes like this:
  1. Table Name - This is where you put the name of the Table the Names are inserted into. ex: "Civilization_CityNames" with cities.
  2. Column 1 Name - This is where you define the Type's Column name. ex: "CivilizationType" with cities
  3. Column 2 Name - This is where you define the TXT Reference's Column Name. ex: "CityName" with cities
  4. Column 1 Shared Value - This is where you define what Type that will be shared with the entire list. With Cities this would be the name of the Civilization you are adding them to.
  5. Column 2 Shared Start - This is where you define the first part of the TXT_KEY. Something like "TXT_KEY_SPY_NAME_" for spies. After that I use Column 1 Shared Value, and a count to define the TXT_KEY for each on the list.
  6. Start of List - Every line after and including this will be an additional value for the list. This is where you take the list of Cities, Spies, Heads of Government, or whatever with how they should appear in game.
Next you need to run the program. It's set to a executable, but if you are having trouble running the program try:
Spoiler :

*Note this is a WINDOWS Guide. I could do a Linux, but if you're using Linux I'm pretty sure you know what you're doing. IOS I can't help sorry.
  1. Make sure the latest version of Java is installed.
  2. Open the command console.
  3. When open enter "cd {Location of .jar file}" into the prompt.
  4. Next enter "java -jar AutoTXTFromFile.jar" into the prompt.
  5. This should make it run if it's not executing.

Next you'll know it worked if the files exist in the "Auto-Civ5Folder" Folder.

Downloads:
Program and Required Files
Source Code
 
Top Bottom