file::split(3)

NAME

FILE::SPLIT

SYNOPSIS

Splits files.
my $fs = File::Split->new({keepSource=>'1'});
my $files_out = $fs->split_file({'parts' =>
10},'filepath');

DESCRIPTION

File::Split defaults to removing the now-split file. my
$fs = File::Split->new({keepSource=>'1'});

Split the file into ten equal-sized parts called
filepath.1,filepath.2,... my $files_out =
$fs->split_file({'parts' => 10},'filepath');

Split the file into multiple parts with a size of 1000
lines or less. my $files_out = $fs->split_file({'lines'
=> 1000},'filepath');

#Split files into sub-sections based on a substring value.
Gives filepath.MB, filepath.SK my $files_out =
$fs->split_file({'sub
str'=>{pos=>'10000',val=>['MB','SK']}},'filepath');

# Split file based on regular expressions grouped in a
hash of arrays of regular expressions. Gives files
filepath.BC, filepath.AB,... my $files_out =
$fs->split_file({'grep'=>{
'BC'=>['(V'],
'AB'=>['(T'],
'SK'=>['(S'],
'MB'=>['(R'],
'ON'=>['(P','(N','(M','(L','(K'],
'QC'=>['(G','(H','(J','(K','(S'],
'NS'=>['(B'],
'NB'=>['(E'],
'PE'=>['(C'],
'NL'=>['(A'],
'NT'=>['(X'],
'NU'=>[],
'YT'=>['(Y'],
}
},'dat/zip411Bus040710.TXT');
Split file on array of regular expressions. filename
extensions are based on the matched value. $files_out =
$fs->split_file({'grep'=>['(MB)','(SK)','(NB)','(NL)','(NT)','(NS)','(YT)','(PE)','(NU)','(BC)','(ON)','(AB)','(QC)']},'dat/zip411Bus041013.TXT');
Merge any file that matches 'filepath_for_recon
structed_file*' my $out_name =
$fs->merge_file('filepath_for_reconstructed_file');

AUTHOR

Phil Middleton
Copyright © 2010-2025 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout