Kgs has asked for the wisdom of the Perl Monks concerning the following question:
Hey Monks,
I am a newb trying to figure out how I can append text files of the same name in different directories. Specifically, I have a directory with about 5000 subdirectories. Each subdirectory contains 500 text files where the name of the file is (potentially) non-unique. That is, there may be a file called name.txt in folders 000, 100, 940, and 1000.
I would like to find all instances where the file name is non-unique and APPEND them (e.g., append name.txt in folders 000, 100, 940, and 1000 above). The individual files can be deleted and the new appended file can be placed in any of the originating folders (i.e., 000, 100, 940, or 1000.)
Hopefully I have made myself clear :) I am using Strawberry Perl on Windows 10 64bit
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: [newbie question] Appending txt files with same name in different subdirectories
by hippo (Archbishop) on Aug 17, 2016 at 10:35 UTC | |
by Kgs (Novice) on Aug 18, 2016 at 00:04 UTC |