wizacode/php-etl

file name handling in CsvLoader

Closed this issue · 0 comments

The CsvLoader append fileCounter and the .csv file extension, in any case (using the linePerFile option or not).

We force the class consumers to feed an incomplete file path.
Ex.: input file name: /path/to/my/file produce:

  • /path/to/my/file_0.csv
  • /path/to/my/file_1.csv
  • /path/to/my/file_2.csv

In order to let the CsvLoader class consumers having full control of the file path, i suggest to make 0 silent in the file name generation, and to use pathinfo for the file name extension extraction.

Ex.: input file name: /path/to/my/file.csv will produce:

  • /path/to/my/file.csv
  • /path/to/my/file_1.csv
  • /path/to/my/file_2.csv

And/Or using the linePerFile option to activate or not this first _0 file name suffix.