Can you fill a TMap from a data table and/or CSV?

Just wondering whether it would be possible to fill a TMap with data from a CSV file? I am looking to fill a TMap with a bunch of entries (like, 60,000), from which I will be able to look up an item by key. Is this possible or am I barking up the wrong tree?

Hey there ,

Yes it is possible, if your willing to use C++, or that is the way I would do it, I wouldn’t be asking Blueprints to do 60,000 or even (10,000) of anything. C++ would also allow you to expose the functionality you create to blueprints as a new node, so that you could pass in parms with the blueprints, and control how the C++ executes easily.

Inc.

Great. I am definitely aiming to do it via C++. Do you have any links to content that might point me in the right direction? I haven’t been able to find anything much out there.

,

Take a look in the wiki, for some code from Rama, that will get you started on some of the file operations you will need. Then look into the engine itself, for some utility functions for CSV, you will also need to look at the documentation for dealing with Blueprint function libraries (there is some stuff in the Wiki as well, along with official documentation from Epic). Use keywords like BlueprintPure, BlueprintCallable for your search. Sorry I don’t have the links off the top of my head, but you will need to get use to search for things in the official documentation as well. Essentially your going to be creating static functions, in a library, to be able to allow blueprints to call into it. Which when you think about it, is very powerful, and to me, it’s definitely the way to go.

Inc.

Thanks for the pointers. I will look into it :slight_smile:

Very good! and have fun of course!