I need to merge the contents of two folders sequentially into individual destinations. Here is what i have. A,B,C,D,E,F are individual files.
Folder 1:
A
B
C
...
Folder 2:
D
E
F
...
At the output i need merged files sequentially. So they should be merged like this:
Output:
AD
BE
CF
...
In other words, first file from the Folder 1 with the first file from the Folder 2. Second file from the Folder 1 with the second file from the Folder 2. In our case AD is consisting of the content of files A and D, BE consisting of files B and E, etc.
Both folders have the same number of files. Output can go anywhere. For the sake of simplicity let's call it Output folder and locate it in the same root as Folder 1 and 2.
Been looking for the solution for two days now. Yikes!
Assuming that by "merge" you mean concatenate the files' contents, you could do something like this:
This will create files in the current directory, whose name is the concatenation of the two constituent filenames. It assumes that you want to merge files in the order in which they sort in your locale. The null delimiters make it safe for any legal filenames (which may be overkill for your application).