Split Data File
About this tool
How to use it
- Choose this tool.
- Add your data file with Upload or drag and drop.
- Choose how to split: rows per file, number of files, or by a column.
- Choose the format of the files, then press Generate.
- Download the result, a ZIP with all the files.
What you get back
Try Split Data File in the Studio
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/data/split" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'file=@document.pdf' \
-F 'rows=1000' \
-F 'parts=4' \
-F 'by=country'Node.js
const { DavixH2I } = require('@davixlabs/h2i-sdk');
const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.data.split({
"file": 'document.pdf',
"rows": 1000,
"parts": 4,
"by": "country"
});
console.log(result.data, result.requestId);PHP
<?php
require 'vendor/autoload.php';
$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->data()->split([
'file' => 'document.pdf',
'rows' => 1000,
'parts' => 4,
'by' => 'country',
]);
echo $result->requestId;