Jump to content

Extracting City data from editor to a list/csv


Crono_
 Share

Recommended Posts

Hello, i'm making a custom league (Level 8 italy) for FM2022 and i need to add some clubs in order to make the league work. I should add like 780 clubs and im looking for a way to automatize most of the process, so i wonder if there is a way to retrive city UID and names from the database to a file that later i can use in my script to automatize club's creation. Thanks in advance for the help!

Link to post
Share on other sites

If it's just the UID and name, it's not too bad, although still pretty tedious (unless someone else knows a better way, which I'd be delighted to hear).

  • Go into the editor and load a fresh database
  • Do a search for cities with no parameters to get all of them (make sure you set the Maximum Records per Search value in settings to Unlimited)
  • Select all, then click edit
  • It'll take a while, but once it's done getting them all, you'll see what looks like a blank city object.  Change the name to anything (I usually just use A)
  • This will again take a while, and the editor will be unresponsive throughout, but once it's back that should have changed every single city to have the same name
  • Export those changes (not save) which will give you an XML file
  • From that, you'll get an entry for each city with the "old" name, and db id within.  You'll need to do some parsing of the data at that point, I use Python.  from that you can pretty easily build up any format you need

I probably still have a copy of exactly this list of IDs somewhere, can check when I'm back on my laptop if you'd like.

Link to post
Share on other sites

57 minuti fa, forameuss ha scritto:

If it's just the UID and name, it's not too bad, although still pretty tedious (unless someone else knows a better way, which I'd be delighted to hear).

  • Go into the editor and load a fresh database
  • Do a search for cities with no parameters to get all of them (make sure you set the Maximum Records per Search value in settings to Unlimited)
  • Select all, then click edit
  • It'll take a while, but once it's done getting them all, you'll see what looks like a blank city object.  Change the name to anything (I usually just use A)
  • This will again take a while, and the editor will be unresponsive throughout, but once it's back that should have changed every single city to have the same name
  • Export those changes (not save) which will give you an XML file
  • From that, you'll get an entry for each city with the "old" name, and db id within.  You'll need to do some parsing of the data at that point, I use Python.  from that you can pretty easily build up any format you need

I probably still have a copy of exactly this list of IDs somewhere, can check when I'm back on my laptop if you'd like.

Thanks you so much im going to try that, i've read about memory dump, im glad that it's "only" this. When the script tool im building is finished im gonna share with y'all hoping that mass editing would be simpler for anyone :D I have another question: this method can be used also with stadium and clubs? if needed

Link to post
Share on other sites

6 ore fa, forameuss ha scritto:

If it's just the UID and name, it's not too bad, although still pretty tedious (unless someone else knows a better way, which I'd be delighted to hear).

  • Go into the editor and load a fresh database
  • Do a search for cities with no parameters to get all of them (make sure you set the Maximum Records per Search value in settings to Unlimited)
  • Select all, then click edit
  • It'll take a while, but once it's done getting them all, you'll see what looks like a blank city object.  Change the name to anything (I usually just use A)
  • This will again take a while, and the editor will be unresponsive throughout, but once it's back that should have changed every single city to have the same name
  • Export those changes (not save) which will give you an XML file
  • From that, you'll get an entry for each city with the "old" name, and db id within.  You'll need to do some parsing of the data at that point, I use Python.  from that you can pretty easily build up any format you need

I probably still have a copy of exactly this list of IDs somewhere, can check when I'm back on my laptop if you'd like.

Hi i've done that but the exported xml it's all image.png.05278611d4ec72c808ea289f693115e8.pngnew value a. Am i doing something wrong?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...