Segmentation to files in words order