I have 3000 text files in a directory and each .txt
file contain single column data. i want to arrange them side by side to make it a mxn matrix file.
For example: paste 1.txt 2.txt 3.txt 4.txt .............3000.txt
in linux
For this i tried
printf "%s
" *.txt | sort -n | xargs -d '
' paste
However it gives error paste: filename.txt: Too many open files
please suggest a better solution for the same using python.
See Question&Answers more detail:os