# Exporting a CSV structure array file

**URL:** <https://forums.unrealengine.com/t/exporting-a-csv-structure-array-file/488683>\
**Category:** Editor Scripting\
**Tags:** arrays, csv, unreal-engine, question, CPP\
**Created:** [September 12, 2021, 9:54am UTC](https://forums.unrealengine.com/t/exporting-a-csv-structure-array-file/488683 "2021-09-12T09:54:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_47451bc2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_47451bc2](https://forums.unrealengine.com/u/anonymous_user_47451bc2)\
**Post date:** [September 12, 2021, 9:54am UTC](https://forums.unrealengine.com/t/exporting-a-csv-structure-array-file/488683/1 "2021-09-12T09:54:21Z")

</div>

Hello,

I’ve figured out how to export a CSV file containing a String array during runtime, but I’m not sure how to make this function work for a _structure_-based array. If it’s important, my structure contains a transform, a float, a float, and a bool, in that order. I’d eventually like to import this data into a different project and be able to use the transform variable data, the float variables’ data, etc. I’m still quite new to C++, so specific suggestions would be appreciated!

Here’s the C++ that works for the String array:

```
*TextFileManager.cpp:*

#include "TextFileManager.h"
#include "Misc/FileHelper.h"
#include "HAL/PlatformFilemanager.h"

bool UTextFileManager::SaveArrayText(FString SaveDirectory, FString FileName, TArray<FString> SaveText, bool AllowOverwriting = false)
{ //set complete file path

SaveDirectory += "\\";
SaveDirectory += FileName;

if (!AllowOverwriting)
{
	if (FPlatformFileManager::Get().GetPlatformFile().FileExists(*SaveDirectory))
	{
		return false;
	}
}

FString FinalString = "";
for (FString& Each : SaveText)
{
	FinalString += Each;
	FinalString += LINE_TERMINATOR;

}

return FFileHelper::SaveStringToFile(FinalString, *FSaveDirectory);

```

–

```
*TextFileManager.h:*

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "TextFileManager.generated.h"

/**
 * 
 */
UCLASS()
class GHOSTCARDEMO_API UTextFileManager : public UBlueprintFunctionLibrary
{
GENERATED_BODY()

	UFUNCTION(BlueprintCallable, Category = "Custom", meta = (Keywords = "Save"))
	static bool SaveArrayText(FString SaveDirectory, FString FileName, TArray<FString> SaveText, bool AllowOverwriting);

};

```

–

If you have any ideas, it’d be much appreciated. I’m strugglin with this one. Thank you!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_47451bc2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_47451bc2](https://forums.unrealengine.com/u/anonymous_user_47451bc2)\
**Post date:** [September 12, 2021, 10:25am UTC](https://forums.unrealengine.com/t/exporting-a-csv-structure-array-file/488683/2 "2021-09-12T10:25:52Z")

</div>

(Also, I’m specifically trying to avoid turning the translation variable into a string, as the translation’s rotation would bring quaternions into the picture, and quaternions = nty)
