i have 10 different subdirectories with same file names in each directory ( 20 files per directory ) and column 0 is the index column in each file.
e.g
This can be achieved in much simple way in shell as:
find . -name "*.csv" | xargs cat > mergedCSV
(Note: Don't use .csv in extension as it will cause inconsistency with find. After this command is finished, file can be renamed as .csv