FWF
- Full name:
\MammothPHP\WoollyM\IO\FWF - Parent class:
\MammothPHP\WoollyM\IO\Builder
Properties
colSpecs
Colspecs
php
public array $colSpecsincludeRegexOpt
Whitelist regex to apply to each line of the file
php
public ?string $includeRegexOptexcludeRegexOpt
Blacklist regex to apply to each line of the file
php
public ?string $excludeRegexOptMethods
format
Apply formats options
php
public format(array $colSpecs): selfParameters:
| Parameter | Type | Description |
|---|---|---|
$colSpecs | array |
filter
Apply filter options
php
public filter(?string $includeRegexOpt = null, ?string $excludeRegexOpt = null): selfParameters:
| Parameter | Type | Description |
|---|---|---|
$includeRegexOpt | ?string | |
$excludeRegexOpt | ?string |
import
php
public import(\MammothPHP\WoollyM\DataFrame $to = new DataFrame()): \MammothPHP\WoollyM\DataFrameParameters:
| Parameter | Type | Description |
|---|---|---|
$to | \MammothPHP\WoollyM\DataFrame |
loadFile
Loads the file which the FWF class was instantiated with.
php
protected loadFile(string $fileData): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$fileData | string |
applyColSpecs
Parses a string of data based on the rules defined in user provided colspecs.
php
private applyColSpecs(string $data, array $colSpecs): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$data | string | |
$colSpecs | array |
Inherited methods
fromFilePath
php
public static fromFilePath(string $path): static- This method is static.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$path | string |
fromFileInfo
php
public static fromFileInfo(\SplFileInfo $file): static- This method is static.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$file | \SplFileInfo |
fromString
php
public static fromString(string $input): static- This method is static.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$input | string |
convertSplFileToString
php
protected convertSplFileToString(): stringimport
php
public import(\MammothPHP\WoollyM\DataFrame $to = new DataFrame()): \MammothPHP\WoollyM\DataFrame- This method is abstract.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$to | \MammothPHP\WoollyM\DataFrame |
toArray
php
public toArray(): arrayAutomatically generated on 2024-07-03