Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: "Raws" dump to CSV?  (Read 882 times)

Rochndil

  • Bay Watcher
  • Mad Modder
    • View Profile
"Raws" dump to CSV?
« on: March 16, 2009, 02:36:46 pm »

Good afternoon.

I'm contemplating yet another project (I know, I haven't finished the first one yet), and what I need is to translate the data for all the mineral/stone/soil raws into a CSV file. I can do the data-crunching the hard way, of course, but it'd be nice to have a faster (and less error-prone) method.

Suggestions?

Rochndil, dreading all that re-keying...
Logged
Build an Elf a fire, keep him warm for a day.
Drown an Elf in magma, keep him warm for the rest of his life!

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: "Raws" dump to CSV?
« Reply #1 on: March 16, 2009, 02:39:32 pm »

I'd suggest using Perl for it. Assuming you know how to program, of course. Should be trivial to throw it all into a hash and get it outputted as a CSV.
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

Rochndil

  • Bay Watcher
  • Mad Modder
    • View Profile
Re: "Raws" dump to CSV?
« Reply #2 on: March 16, 2009, 03:18:00 pm »

Yah, IF I could program. :) I'm a tech writer, my only programming background was about a century ago when I studied Turbo Pascal 3.0 in my undergraduate days. I've heard of Perl, but never touched the beast.

Rochndil, who does have an MS, but in the wrong field...
Logged
Build an Elf a fire, keep him warm for a day.
Drown an Elf in magma, keep him warm for the rest of his life!

Great Cthulhu

  • Bay Watcher
  • Likes metal for its screaming guitars.
    • View Profile
Re: "Raws" dump to CSV?
« Reply #3 on: March 17, 2009, 04:41:54 pm »

I'm feeling helpful today. :)

Let me know what you think.
Logged

Rochndil

  • Bay Watcher
  • Mad Modder
    • View Profile
Re: "Raws" dump to CSV?
« Reply #4 on: March 18, 2009, 07:56:40 am »

Thank you very much!

I'll take it for a spin later on today. The next phase of my MMO (Metals and Minerals Overhaul) project is to set all the tile and color values for all the "in the ground" items based on some more logical rules. BUT, before I do that, I need to read out what things are NOW, and distill all that data into a spreadsheet. I could do it by hand (and actually started on the layout yesterday), but that's a lot of manual data-keying. CSV import won't be perfect either (since not all raws are in proper order), but it'll be a HELL of a lot better than doing it all by hand.

Thanks again, ancient dreamer!

You might want to check this http://www.macguff.fr/goomi/unspeakable/ out, when you want a chuckle.

Rochndil, who is almost ready for a beta release of phase 1...
Logged
Build an Elf a fire, keep him warm for a day.
Drown an Elf in magma, keep him warm for the rest of his life!

Great Cthulhu

  • Bay Watcher
  • Likes metal for its screaming guitars.
    • View Profile
Re: "Raws" dump to CSV?
« Reply #5 on: March 18, 2009, 05:03:20 pm »

Hey, no problem. Just let me know if you run into any problems.

Thanks for the link! :)
Logged