All-Aircraft-Simulations
can someone make a tool to alphabetise a text file? - Printable Version

+- All-Aircraft-Simulations (https://allaircraftsimulations.com)
+-- Forum: IL2 Skins, Textures, Patches, Utilities Missions & Campaigns (https://allaircraftsimulations.com/forumdisplay.php?fid=272)
+--- Forum: Il2 Patches & Utilities (https://allaircraftsimulations.com/forumdisplay.php?fid=301)
+--- Thread: can someone make a tool to alphabetise a text file? (/showthread.php?tid=65896)



can someone make a tool to alphabetise a text file? - fabianfred - 22.10.2009

I looked on the net and only found shareware....for something I'd use only occasionally it seems too much.
is it simple to make a program to put a text file into alphabetical order?

The maps/all.ini for example

also a tool to take our static.ini and add a number to the end of each heading...so we can find it easily in the FMB Object list

for example......

[buildings.House$CrimeaBarnStucco] //1
Title CrimeaVillage_BarnStucco
MeshLive 3do/Buildings/Crimea/BarnStucco/live.sim
MeshDead 3do/Buildings/Crimea/BarnStucco/dead.sim
Body RockMiddle
Panzer 0.24

[buildings.House$CrimeaBarnWood] //2
Title CrimeaVillage_BarnWood
MeshLive 3do/Buildings/Crimea/BarnWood/live.sim
MeshDead 3do/Buildings/Crimea/BarnWood/dead.sim
Body WoodMiddle
Panzer 0.12

[buildings.House$CrimeaChurch] //3
Title CrimeaVillage_Church
MeshLive 3do/Buildings/Crimea/Church/live.sim
MeshDead 3do/Buildings/Crimea/Church/dead.sim
Body RockMiddle
Panzer 0.12

[buildings.House$CrimeaFarm] //4
Title CrimeaVillage_Farm
MeshLive 3do/Buildings/Crimea/Farm/live.sim
MeshDead 3do/Buildings/Crimea/Farm/dead.sim
Body WoodMiddle
Panzer 0.15



- Stavinsky - 22.10.2009

i know it's a software that you will have to pay for,
but i guess that you should perhaps take a look
at Ultra Edit. It's definitively a must have when you are
working with text files and doing such kind of
things. It has a nice lot of possibilities
(column sorting, replace using some 'arcane' formula
that let you 'replace' text or add part in very interesting ways.)

I used it a lot as a programmer, and i use it now at home
and i would not be far if i said that i have it open at least once
a day.

Among other things you can also 'program' some 'keywords'
to have it highlights informations the way you want them
it can be helpfull when working on a huge file like the different
*.ini we have in il2.


I know it's not a free software, but definitively (in my opinion)
a must have for everyone doing that kind of works with text
files.

http://www.ultraedit.com/

PS : if i remember right i use it since 1998-1999, over 10 years
and it realy kept giving me what i was needing when working
with text files.


- Salmo - 22.10.2009

PERL scripts are good to manipulate text files.


- fabianfred - 22.10.2009

Salmo Wrote:PERL scripts are good to manipulate text files.

I'm afraid my programming days stopped with BBC Basic for the BBC Acorn B 32k computer.....


- chanklaus - 23.10.2009

Writing a PERL script doing this sorting in general isn't really that much of a problem. What usually takes most of the time is all that overhead you need for file selection, etc. I'm just writing some scripting along those lines, and the most time-consuming part is the graphics window. Writing a command line tool doesn't really take so long - well, depending on the exact task that has to be done, I should add.

The devil sticks in the details, though. I just wrote a routine sorting an entry line into the air.ini, without changing its general structure. But what you normally do in a minute just with a text editor isn't that easy with a script. Even if the aircraft list was originally sorted in an alphabetical order the program would sort a new entry into the file not always as you'd expect, eg. 'xyz9' comes AFTER 'xyz13' if you use a normal sorting function. And if the file is in alphabetical order, but separated into an 'allies' and an 'axis' part it takes even more program code to get a more or less satisfying result.

UltraEdit is nice, I agree, but the 'TextPad' is also a great tool - and freeware:
http://www.textpad.com/

The best text editor, though, I have ever seen - and use for years un UNIX systems - is the 'nedit', but to install it on a windows system is not easy - or at least was when last time I tried it:
http://www.nedit.org/

Best greetings and wishes,

chanklaus