Download the PHP package otzy/csv-converter without Composer

On this page you can find all versions of the php package otzy/csv-converter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package csv-converter

CSV Converter

Transforms CSV file (or any plain text file with some delimiter) into a file with different set of fields.

Features

Installation

CsvConverter class

To read source CSV and write to destination CSV the class uses league/csv Reader and Writer. Thus you can use reach functionality of league/csv package when you need to read/write using different encodings, BOM, stream filters, etc.

Mapping

To convert you should first create mapping.

Mapping is an associative array that defines which fields from the source file will be saved to the destination file. Keys in this array are field names of destination CSV and values are the corresponding fields from the source SCV.

Instead of field name you cn use callback to perform any transformation on input field.

This is an example of simple mapper:

The mapper above will output 3 fields to the destination: "field two","field one","concat"

the third field will be concatenated from fields one and two from the source file.

CSVConverter usage example

Events

Convert emits 3 types of events

You can use events for example for logging or to show the progress of conversion.

BeforeConvert can be used also to filter rows. If event handler returned false the row will not be written to the destination stream.

Event handlers can be set using the following functions:

public function onBeforeConvert($callback) public function onRowConverted($callback) public function onCompleted($callback)


All versions of csv-converter with dependencies

PHP Build Version
Package Version
Requires league/csv Version ^9.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package otzy/csv-converter contains the following files

Loading the files please wait ....