Author Topic: CSV file for data in the dat files (updated)  (Read 4816 times)

0 Members and 1 Guest are viewing this topic.

Offline MagnusA

CSV file for data in the dat files (updated)
« on: March 13, 2011, 12:21:59 PM »
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
« Last Edit: March 27, 2011, 07:44:14 AM by MagnusA »

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4849
  • Total likes: 25
  • Helpful: 63
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: CSV file for data in the dat files?
« Reply #1 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?

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!

Offline MagnusA

Re: CSV file for data in the dat files?
« Reply #2 on: March 13, 2011, 01:52:25 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.

Offline MagnusA

Re: CSV file for data in the dat files (updated)
« Reply #3 on: March 27, 2011, 07:50:07 AM »
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
« Last Edit: March 27, 2011, 08:24:42 AM by MagnusA »

Offline electroduck

Re: CSV file for data in the dat files (updated)
« Reply #4 on: April 08, 2011, 11:01:03 PM »
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? ???
EAT BASE 64!
$TXkgbmFtZSBpcyBlbGVjdHJvZHVjay4NCllvdSBjYW4gdmlzaXQgbXkgd2ViIHNpdGUgYXQgaHR0cDovL3d3dy5lbGVjdHJvZHVjay5jb20vDQpJIGxpa2UgRG9mdXMgYW5kIFNpbXV0cmFucy4=

Offline MagnusA

Re: CSV file for data in the dat files (updated)
« Reply #5 on: April 09, 2011, 05:11:25 PM »
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)

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8725
  • Total likes: 303
  • Helpful: 228
  • Languages: De,EN,JP
Re: CSV file for data in the dat files (updated)
« Reply #6 on: April 09, 2011, 06:37:51 PM »
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.