Download

UStruct and DataTable

Hi there,

Im trying to find the right way to write UStruct informations in the csv file for DataTable but can’t find any way to get it working. By looking at the DataTable code structs are in the supported format but not much has been found as how you need to write it in the csv or how to retreive that information via c++ once the Table is created.

Has anyone know how to do it? Also are TArray are planned to be supported by DataTable?

Regards

You would need to format your struct info into a string but you can read and write a csv file as a single string or as an array of strings (Each array element is a single line). You can do this by using the FFilehelper module which i have linked the documentation here: [https://docs.unrealengine.com/en-US/...per/index.html

e.g](FFileHelper | Unreal Engine Documentation)


FFileHelper::[SaveStringArrayToFile](https://docs.unrealengine.com/en-US/API/Runtime/Core/Misc/FFileHelper/SaveStringArrayToFile/index.html)( const [TArray](https://docs.unrealengine.com/en-US/API/Runtime/Core/Containers/TArray/index.html) < [FString](https://docs.unrealengine.com/en-US/API/Runtime/Core/Containers/FString/index.html) >& Lines, const [TCHAR](https://docs.unrealengine.com/en-US/API/Runtime/Core/HAL/TCHAR/index.html) * Filename)