A colleague of mine has a folder full of assorted files. Among these are a large number of text files (with the extension .tmp). These files contain a text string which needs to be extracted and used to create new directories (i.e the text is the new directory name). There are many many files, so to open them manually, read the text, create a new folder and rename it appropriately, would take too long.
I need to find some code that will achieve the following:
Loop through the directory to find the relevant files (i.e .tmp extension), search each file in turn for a piece of text, when found append text to another file, possible to create a batch file which could be run to create the new folders.
I have attached a sample file (renamed .txt), in this case the text to be extracted would be BE-VER.102
i.e the text after the ‘FOLDER NAME’ on the first line
Any help gratefully received