CVS
A lightweight extension that provides CVS functionality.
What is CSV?
CSV (Comma-Separated Values) is a simple file format used to store tabular data, such as a spreadsheet or database. Each line of the file is a data record consisting of one or more fields, separated by commas. CSV files are widely used for data exchange between different applications and systems.
Features
Read CSV from file path
Parse CSV from string content or Unity TextAsset
Header row handling
Proper handling of quoted fields
Empty line skipping
Regex-based reliable parsing
Reading from File
Reading from String
Reading from Unity TextAsset
Reading Single Line
Features Details
Quoted Field Support: Properly handles fields containing commas (e.g.,
"Los Angeles, CA"
)Empty Line Handling: Automatically skips empty or whitespace-only lines
Header Row Option: Easily skip header row when needed
Multiple Input Sources: Support for file paths, strings, and Unity TextAssets
Memory Efficient: Uses
IEnumerable
for lazy evaluation
Best Practices
Always specify
hasHeader
explicitly for better code readabilityUse appropriate method based on your data source (file/string/TextAsset)
Handle potential file not found exceptions when using
ReadAsCsvFile
Consider line endings when working with different platforms
Last updated