I have several folders with files. Files can have the same names. I want to concatenate files into one of each name. Thanks in advance.
EDIT: I\'m sorry
This is simple — you have go write each file to the same directory making sure you are appending. This does not guarantee any sort of order preference, so I assume it's irrelevant. You have not specified a language or whether this is for the shell, so I can't suggest an implementation (yet).
This problem can be broken down into the following tasks. First you need a list of all the files. This can be done with ls -r
or some PL specific way, if you are "programming". Then you need to figure out for each file path, where to write and that involves a regex or probably even a split on "/". Then you just want to read and append each file from A to B and that's it. Either do that with cat a >> b
or with whatever language libraries you are using.