Download the PHP package redcatphp/csv-tools without Composer

On this page you can find all versions of the php package redcatphp/csv-tools. 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-tools

No longer actively maintained. I work now with NodeJS and I recommand you to take a look at PapaParse

CSV Tools

taken from DelimiterFinder https://github.com/darraghenright/DelimiterFinder

with composer, namespace and autoload support

A little utility class that reads a .csv or .dat (or whatever) file and tries to guess the delimiter

Usage

Create an instance

Include the file and create a new instance in the usual way; the constructor takes a filepath as a required argument:

require_once dirname(__FILE__) . '/DelimiterFinder.php';

try {
    $finder = new DelimiterFinder('path/to/data.csv');
} catch (InvalidArgumentException $e) {
    // file does not exist :o 
} catch (RuntimeException $e) {
    // file is not readable :(
}

The object will try to open a file handle on the filepath provided. If the file is unreadable or non-existent exceptions will be thrown.

Find

Assuming all went smoothly to this point, it's time to try to guess the delimiter.

The class searches for a likely delimiter from the following list of usual suspects:

Just call the find method:

$delimiter = $finder->find();

If successful, find() stores and returns the matched delimiter. Subsequent calls to do not search the document again; they just return the stored match.

If at first you don't succeed...

If a match is not successful, the find() method returns false. Subsequent calls to find() will search the document again. You can add any number of custom delimiters to search, which makes repeat searches a little more useful ;)

$finder->addDelimiter('|');
$delimiter = $finder->find(); // pipe-delimited file? success!

All versions of csv-tools with dependencies

PHP Build Version
Package Version
No informations.
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 redcatphp/csv-tools contains the following files

Loading the files please wait ...