PHP Classes

PHP Split CSV: Split CSV files input multiple parts set by rules

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 72%Total: 503 All time: 5,803 This week: 47Up
Version License PHP version Categories
split-csv 1.0.0BSD License5.3.0PHP 5, Files and Folders
Description 

Author

This package can split CSV files input multiple parts set by rules.

It can read CSV files by row and write their contents to new multiple CSV files.

The package provides classes that implement different rules for defining where to split the original CSV file.

Currently it provides a rule class that splits the file by size and other to split the file by number of record rows.

Picture of Sergii Pryz
  Performance   Level  
Name: Sergii Pryz <contact>
Classes: 10 packages by
Country: Ukraine Ukraine
Age: 40
All time rank: 134021 in Ukraine Ukraine
Week rank: 304 Up5 in Ukraine Ukraine Up
Innovation award
Innovation award
Nominee: 4x

Details

SplitCSV ======== Objective --------- SplitCSV helps to split comma separated value file (CSV) into chunks by configurable options: * Each file's part contains first row from original file (or several one) * Every file's part has name as original but with a prefix Of course it is not possible to implement all varies of algorithms of splitting. Therefore SplitCSV presents AbstractRule and RuleInterface to add user rules. Split Rules ----------- There are two split rules that is available from box: * Split by number of rows * Split by file size Area of usage ------------- There are several fields where better have several files instead of one: * Project log files to prevent them growing to gigantic size * Reports before sending them off by email * Price list from different stores before import them to someone * Prepare data for parallel calculation to make possible spread data between servers or processes ### Example The example file can be found here: `/Example.php`

  Files folder image Files (21)  
File Role Description
Files folder imagedocs (1 directory)
Files folder imagesrc (1 file, 1 directory)
Files folder imagetests (2 files, 2 directories)
Accessible without login Plain text file CHANGELOG.md Data Documentation
Accessible without login Plain text file Example.php Example Example script
Accessible without login Plain text file LICENSE.txt Lic. Documentation
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (21)  /  docs  
File Role Description
Files folder imageuml (1 file)

  Files folder image Files (21)  /  docs  /  uml  
File Role Description
  Accessible without login Image file class.diagram.png Data Auxiliary data

  Files folder image Files (21)  /  src  
File Role Description
Files folder imageSplitCSV (4 files, 1 directory)
  Accessible without login Plain text file Autoload.php Aux. Class source

  Files folder image Files (21)  /  src  /  SplitCSV  
File Role Description
Files folder imageRule (5 files)
  Plain text file AbstractFile.php Class Class source
  Plain text file Exception.php Class Class source
  Plain text file File.php Class Class source
  Plain text file FileInterface.php Class Class source

  Files folder image Files (21)  /  src  /  SplitCSV  /  Rule  
File Role Description
  Plain text file AbstractRule.php Class Class source
  Plain text file Exception.php Class Class source
  Plain text file FileSize.php Class Class source
  Plain text file NumberRow.php Class Class source
  Plain text file RuleInterface.php Class Class source

  Files folder image Files (21)  /  tests  
File Role Description
Files folder imagedata (1 file)
Files folder imagesrc (1 directory)
  Accessible without login Plain text file bootstrap.php Aux. Class source
  Accessible without login Plain text file phpunit.xml Data Auxiliary data

  Files folder image Files (21)  /  tests  /  data  
File Role Description
  Accessible without login Plain text file test-10000-rows-357kb.csv Data Auxiliary data

  Files folder image Files (21)  /  tests  /  src  
File Role Description
Files folder imageSplitCSV (2 files, 1 directory)

  Files folder image Files (21)  /  tests  /  src  /  SplitCSV  
File Role Description
Files folder imageRule (1 file)
  Accessible without login Plain text file BaseTest.php Test Unit test script
  Accessible without login Plain text file FileTest.php Test Unit test script

  Files folder image Files (21)  /  tests  /  src  /  SplitCSV  /  Rule  
File Role Description
  Accessible without login Plain text file RuleTest.php Test Unit test script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:503
This week:0
All time:5,803
This week:47Up
 User Ratings  
 
 All time
Utility:83%StarStarStarStarStar
Consistency:83%StarStarStarStarStar
Documentation:83%StarStarStarStarStar
Examples:83%StarStarStarStarStar
Tests:58%StarStarStar
Videos:-
Overall:72%StarStarStarStar
Rank:174