# Taking values from text files? (Non Flash I Think)

**URL:** <https://forum.kirupa.com/t/taking-values-from-text-files-non-flash-i-think/90196>\
**Category:** random\
**Created:** [May 15, 2005, 8:17pm UTC](https://forum.kirupa.com/t/taking-values-from-text-files-non-flash-i-think/90196 "2005-05-15T20:17:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben\_is\_sparky](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ben_is_sparky/32/664_2.png) [@ben\_is\_sparky](https://forum.kirupa.com/u/ben_is_sparky)\
**Post date:** [May 15, 2005, 8:17pm UTC](https://forum.kirupa.com/t/taking-values-from-text-files-non-flash-i-think/90196/1 "2005-05-15T20:17:29Z")

</div>

Right, a bit of an odd request, but you’re the cleverest, mosty computer literate people I know, so here I am 😛

I do some modding work on a game, (Rome: Total War) changing skins and altering models etc. there are loads of .txt files that all the info for the units is stored in. What I was wondering was if there was a way to make some kind of app or batch file that could take the information I want out of them and save it as a new .txt file. I want a list, to help me, that list’s each unit’s true name, skin name and model name. Every unit has this information stored across 3 different files:

**export\_descr\_unit.txt  
descr\_model\_battle.txt  
and Text/export\_units.txt**

An Example (roman legionary)  
(; is a comment)

**export\_descr\_unit.txt  
\*\*  
[font=Lucida Console]type roman legionary cohort ii  
dictionary [color=DarkOrange]roman\_legionary\_cohort\_ii[/color] ; Legionary Cohort  
category infantry  
class heavy  
voice\_type Medium\_1  
soldier [color=SeaGreen]roman\_legionary\_cohort\_ii[/color], 40, 0, 1.3  
officer roman\_standard  
attributes sea\_faring, hide\_forest, can\_sap, hardy  
formation 1, 2, 2, 3, 4, square, testudo  
stat\_health 1, 0  
stat\_pri 13, 4, pilum, 35, 2, thrown, blade, piercing, spear, 25 ,1  
stat\_pri\_attr prec, thrown ap  
stat\_sec 9, 4, no, 0, 0, melee, simple, piercing, sword, 25 ,1  
stat\_sec\_attr no  
stat\_pri\_armour 12, 5, 5, metal  
stat\_sec\_armour 0, 1, flesh  
stat\_heat 5  
stat\_ground 2, 0, 0, 0  
stat\_mental 10, disciplined, highly\_trained  
stat\_charge\_dist 30  
stat\_fire\_delay 0  
stat\_food 60, 300  
stat\_cost 1, 740, 210, 80, 120, 740  
ownership romans julii,romans brutii,romans scipii,romans senate[/font]**

descr\_model\_battle.txt  
\*\*  
type [color=SeaGreen]roman\_legionary\_cohort\_ii[/color]  
skeleton fs\_javelinman, fs\_swordsman2 ; throwing javelin  
indiv\_range 40  
texture romans\_julii, data/models\_unit/textures/[color=Magenta]unit\_roman\_legionary\_II\_julii.tga[/color]  
texture romans\_brutii, data/models\_unit/textures/[color=Magenta]unit\_roman\_legionary\_II\_brutii.tga[/color]  
texture romans\_scipii, data/models\_unit/textures/[color=Magenta]unit\_roman\_legionary\_II\_scipii.tga[/color]  
texture romans\_senate, data/models\_unit/textures/[color=Magenta]unit\_roman\_legionary\_II\_senate.tga[/color]  
texture seleucid, data/models\_unit/textures/unit\_greek\_legionary\_seleucid.tga  
model\_flexi\_m data/models\_unit/[color=DeepSkyBlue]unit\_roman\_legionary\_high.cas[/color], 15  
model\_flexi\_m data/models\_unit/[color=DeepSkyBlue]unit\_roman\_legionary\_med.cas[/color], 30  
model\_flexi\_m data/models\_unit/[color=DeepSkyBlue]unit\_roman\_legionary\_low.cas[/color], 40  
model\_flexi data/models\_unit/[color=DeepSkyBlue]unit\_roman\_legionary\_lowest.cas[/color], max  
model\_sprite seleucid, 60.0, data/sprites/seleucid\_roman\_legionary\_cohort\_ii\_sprite.spr  
model\_sprite romans\_senate, 60.0, data/sprites/romans\_senate\_roman\_legionary\_cohort\_ii\_sprite.spr  
model\_sprite romans\_scipii, 60.0, data/sprites/romans\_scipii\_roman\_legionary\_cohort\_ii\_sprite.spr  
model\_sprite romans\_brutii, 60.0, data/sprites/romans\_brutii\_roman\_legionary\_cohort\_ii\_sprite.spr  
model\_sprite romans\_julii, 60.0, data/sprites/romans\_julii\_roman\_legionary\_cohort\_ii\_sprite.spr  
model\_tri 400, 0.5f, 0.5f, 0.5f

\*\* Text/export\_units.txt

\*\*{[color=DarkOrange]roman\_legionary\_cohort\_ii[/color]} [color=Blue]Legionary Cohort[/color]

[color=Blue]Real Name[/color]  
[color=Magenta]Skin Name  
[color=DeepSkyBlue]Model Name  
[color=Black]  
How can I get those 3 bits of info out and into a new text file? For example:

\*\*New\_Txt\_File.txt  
\*\*  
Name: [color=Blue]Legionary Cohort  
[color=Black]Skin:[/color] [/color][/color][/color][/color][color=Magenta]unit\_roman\_legionary\_II\_julii.tga  
[color=Black]Skin: [/color][/color][color=Magenta]unit\_roman\_legionary\_II\_brutii.tga  
[color=Black]Skin:[/color] [/color][color=Magenta]unit\_roman\_legionary\_II\_scipii.tga  
[color=Black]Skin:[/color] [/color][color=Magenta]unit\_roman\_legionary\_II\_senate.tga  
[color=Black]Model: [/color][/color][color=DeepSkyBlue]unit\_roman\_legionary\_high.cas  
[/color][color=Magenta][color=Black]Model: [/color][/color][color=DeepSkyBlue]unit\_roman\_legionary\_med.cas[/color]  
[color=Magenta][color=Black]Model: [/color][/color][color=DeepSkyBlue]unit\_roman\_legionary\_low.cas[/color]  
[color=Magenta][color=Black]Model: [/color][/color][color=DeepSkyBlue]unit\_roman\_legionary\_lowest.cas

[color=Black]Is it doable? How would I even start thinking about this?[/color]  
[/color]
