CSV Functions
Functions for reading and writing CSV files.
ReadCsvFileAsString
Pure Reads an entire CSV file as a single string.
C++
FString ReadCsvFileAsString(const FString& FilePath, const FString& Delimiter = TEXT(","), bool bHasHeader = true)
| Parameter | Type | Default | Description |
|---|---|---|---|
FilePath | FString | - | Full path to the CSV file |
Delimiter | FString | "," | Column delimiter character |
bHasHeader | bool | true | Whether the first row is a header |
Returns: The entire CSV content as a string
Category: EFM|Data|CSV
Blueprint Node
ƒRead Csv File As String
File Path
Delimiter
?
B Has Header
Return Value
ReadCsvFileAsMap
Pure Reads a CSV file into a key-value map.
C++
TMap<FString, FString> ReadCsvFileAsMap(const FString& FilePath, const FString& KeyColumn, const FString& Delimiter = TEXT(","))
| Parameter | Type | Description |
|---|---|---|
FilePath | FString | Full path to the CSV file |
KeyColumn | FString | Column name to use as map keys |
Delimiter | FString | Column delimiter character |
Returns: TMap<FString, FString> where keys are from the specified column and values are from the last column
Category: EFM|Data|CSV
Blueprint Node
ƒRead Csv File As Map
File Path
Key Column
Delimiter
?
Return Value
WriteCsvFile
Callable Writes rows to a CSV file.
C++
bool WriteCsvFile(const FString& FilePath, const TArray<FString>& Rows, const FString& Delimiter = TEXT(","))
| Parameter | Type | Description |
|---|---|---|
FilePath | FString | Full path to the output CSV file |
Rows | TArray<FString> | Each element is a row (columns separated by delimiter) |
Delimiter | FString | Column delimiter character |
Returns: true if the file was written successfully
Category: EFM|Data|CSV
Blueprint Node
ƒWrite Csv File
File Path
Rows
Delimiter
?
Return Value
Example
// Read CSV as string
CsvContent = ReadCsvFileAsString("C:/data/players.csv", ",", true)
// Read CSV as map (keyed by player name)
PlayerData = ReadCsvFileAsMap("C:/data/players.csv", "PlayerName", ",")
// Write CSV
Rows = [
"Name,Score,Level",
"Alice,1500,10",
"Bob,2300,15",
"Charlie,800,5"
]
WriteCsvFile("C:/data/output.csv", Rows, ",")