SplitTxtFile

Splits a very large text file into smaller ones.
2.6K Downloads
Updated 30 Apr 2003

No License

I highly recommend compiling this.

% SPLITTXTFILE(infile,size,formattype,TEST)
%
% Splits text a text file into N lines, such that
% the file size is one line longer than BYTES.
% So if you specify 1 MB files, SPLITTXTFILE will
% split the infile into peices that are 1 MB + 1
% line
%
% inflile is the input file name.
% size is in bytes
% if formattype=0 [default]
% in.txt becomes 001in.txt, 002in.txt, ...
% if formattype=1
% in.txt becomes in.001, in.002, ....
% test=1 then the name of each file will be printed
%
% IT'S NOT FANCY BUT IT WORKS

Cite As

Michael Robbins (2024). SplitTxtFile (https://www.mathworks.com/matlabcentral/fileexchange/3358-splittxtfile), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Dates and Time in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0