News:

SimuTranslator
Make Simutrans speak your language.

CSV file for data in the dat files (updated)

Started by MagnusA, March 13, 2011, 12:21:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MagnusA

Hello!

I discovered this game about a year ago and have been lurking in these forums since then. This is a great game and helpful forums. Thank you all!

Well, as a test project in learning Python I am writng a script that extracts data from the dat files and tabulate them into csv files (semicolon separated). The csv files can then easily be imported into spreadsheets like OpenOffice.org Calc or MS Excel for further analysis and help deciding what loco/bus/truck to buy and so on. Maybe they also can aid in further balancing the pakset?

Probably many of you already have these data tabulated somehow, but it is ok to share my csv files here for others to use? I think it is ok since the dat files are freely available in the svn repositery anyway, but I would like to ask first. The script itself is however too ugly to publish as it is a learning project, at least for now.

The data is from the dat files in pak64 svn r435 (110.0.1?), english version. It is raw data from the dat file (no compensation for bits_per_month and such). Currently there are data from buildings, factories, vehicles, goods and ways, but it is quite easy to expand to more types. It is possible to extract data from other paksets and/or languages as well as long as I can access the dat and lang files.

Please note that only "single value type" of data has been extracted so far. I do not know (yet) how to handle the "array type" of data, like input/output for the factories.

Best regards /Magnus

EDIT: zip file added.

EDIT 2011-03-27: zip file replaced. (Previous version ownloaded 11 times.)

  • Corrected default value of vehicle.gear (1 -> 100)
  • Removed all default parameters except vehicle.gear (leaving blank för missing parameters)
  • Added the "array-type" parameters for factory inputs/outputs
  • Added csv files for fields, citycars, tunnels, bridges, way-objects, roadsigns, tree and ground_objs

VS

Hello! I am not an authority when it comes to pak64, but... Why should that be a problem?

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

MagnusA

Quote from: VS on March 13, 2011, 12:53:39 PM
Hello! I am not an authority when it comes to pak64, but... Why should that be a problem?

Hmm, yes, why not... I have added a zip file in my initial post. Hopefully it is useful.

MagnusA

#3
The csv files are now updated with more object types and parameters. Also a erroneous default value for vehicle.gear was corrected. See top post (Edit 2011-03-27).

/Magnus

electroduck

When I open it in Numbers all the data is mashed into one column.
When I open it in Excel it crashes.
What is going on? ???

MagnusA

The csv files are semicolon separated text files. Excel should not have any problem reading these files, except set to another separator than semicolon. I think the default is "tab".

For me I have to save the csv file to disk and then open it from within Excel. Make sure the separator is semicolon. I have Excel 2000. Doubleclicking makes everything in the same column (no crash)

Maybe that is the problem with Numbers? (wrong separator)

prissi

The way excel reads data depends unfourtunately very much on the country. Originally CSV stand for comma seperated values. But in germany those are used a decimal points, so it will be seperated as semicolons in german windows. Other countries may use their system of decimals and seperators.