Skip to content

CSVExport

ClassAssetInventoryAssetInventory.Editor
public sealed class CSVExport

Exports selected Asset Inventory fields and rows to a configurable comma-separated file.

public const string DEFAULT_FILE_NAME = "assets.csv"

Returns

System.String

public static List<string> GetDefaultFields()

Returns a new list of the recommended package fields used when no CSV column selection was saved.

Returns

System.Collections.Generic.List{System.String}

public static List<string> GetAllFields()

Returns every readable AssetInfo property as a selectable CSV field path.

Returns

System.Collections.Generic.List{System.String}

public static void EnsureSettings(CSVExportSettings settings)

Initializes missing CSV column and separator settings while preserving caller-selected values.

Parameters

Name Type
settings AssetInventory.CSVExportSettings
public Task Run(List<AssetInfo> assets, CSVExportSettings settings, string filePath)

Writes the selected package rows to the requested CSV file, creating its parent directory when necessary.

Parameters

Name Type
assets System.Collections.Generic.List{AssetInventory.AssetInfo}
settings AssetInventory.CSVExportSettings
filePath System.String

Returns

System.Threading.Tasks.Task

public List<string> BuildLines(List<AssetInfo> assets, CSVExportSettings settings)

Builds escaped CSV header and data rows in memory without writing a file.

Parameters

Name Type
assets System.Collections.Generic.List{AssetInventory.AssetInfo}
settings AssetInventory.CSVExportSettings

Returns

System.Collections.Generic.List{System.String}

public CSVExport()