TXT
class TXT (View source)
The GenericDatabase\Helpers\Parsers\TXT class provides methods for parsing, analyzing, and writing TXT and CSV files.
Main funcionalities:
- Checks if all columns in the given data are null
- Uses the structure method to generate the schema information
- Analyze method to determine the column types.
Methods:
allColumnsNull($data): Checks if all columns in the given data are null.parse($filePath): Parses a CSV file at the given file path and returns an array of data.analyze($data): Analyzes the given data and returns an array of column types (e.g., integer, float, datetime, string).structure($filePath, $separator): Returns an array of schema information for CSV files in the given folder path, using the given separator.write($overwrite = false): Writes schema information to a file named "Schemas.ini" in the folder path, overwriting the file if specified.
Methods
static array
parse(string $filePath)
Parses a CSV file and returns its data as an array.
static array
structure(string $filePath, string $separator)
Generates the structure of the CSV files in the specified folder.
static void
write(bool $overwrite = false)
Writes the schema information to a Schemas.ini file.
Details
static array
parse(string $filePath)
Parses a CSV file and returns its data as an array.
static array
structure(string $filePath, string $separator)
Generates the structure of the CSV files in the specified folder.
static void
write(bool $overwrite = false)
Writes the schema information to a Schemas.ini file.