Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
|
Lista Forumurilor Pe Tematici
|
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login
POZE MRRRR'S FORUM (VIEW ONLY)
Nu sunteti logat.
|
Nou pe simpatie: alexxandra din Timis
| Femeie 24 ani Timis cauta Barbat 24 - 57 ani |
|
Mrrrr
AdMiN
Inregistrat: acum 18 ani
Postari: 2241
|
|
I have an empty text file telling me where I can find everything that was inside about 50 folders, and want to put it in each of those 50 folders.
1. Open Excel
2. In column A, enter the word below and drag it to 50 rows or how many folders you got
3. In column B, type the full path of the file you want to copy, between quotation marks and drag it for as many rows as you dragged in step 2
"D:\Whatever Folder\THIS IS THE FILE I WANT TO COPY.txt" |
4. In column C you will have to enter the path of each of the folders you want to copy the above file to. To find them out, simply select them all, SHIFT + Right Click one of them and choose Copy as path - this should copy all folders paths between quotation mark to the Clipboard. Now just paste them in Excel - column C
5. Assuming in columns A, B, and C you have the above, the work "copy" without quotation marks in column A, the full file path between quotation marks in column B, and the full folder paths between quotation marks in column C, then enter the following formula in D1 and drag down:
6. Now copy all the rows from column D into Notepad, and save the file with a name of your desire but the .BAT extension.
7. Run the BAT file.
Source:
_______________________________________
|
|
pus acum 6 luni |
|
Mrrrr
AdMiN
Inregistrat: acum 18 ani
Postari: 2241
|
|
Updated topic title to include copying multiple files to multiple folders.
See my 2nd post in the following topic on how to create multiple text files using Excel and Batch script:
I used that method to create a text file for each grade. Since multiple folders may have the same grade, I used the UNIQUE function to create a list of unique grades (Excel 2021). You can also use the "Remove duplicates" option to create unique grades (it's located in the Data tab).
Currently each of my 100+ folders has a grade in its name, in front of the folder title, eg.: 1,2 Folder 1 title 2,1 Folder 2 title 2,2 Folder 3 title 2,2 Folder 4 title 2,2 Folder 5 title 2,4 Folder 6 title etc. 9,9 Folder n title
After all the folders I have my text files with grades. So the text files are located in the same folder as all my folders above.
In each folder I want to put the corresponding text file. So: in folder named 1,2 Folder 1 title, I want to put the grade = 1,2.txt file in folder named 2,1 Folder 2 title, I want to put the grade = 2,1.txt file in folders named 2,2 Folder 3 title, 2,2 Folder 4 title and 2,2 Folder 5 title, I want to put the grade = 2,2.txt file etc.
In my Excel file I already have the complete names of all the folders in column A starting from A1. The names of the folders were obtained with the Bulk Rename Here utility. In cell B1 I have the formula =LEFT(A1;3) dragged down to obtain the grades. In cell C1 I have the formula ="grade = " & B1 & ".txt" dragged down to obtain the names of the text files.
Now to create the copy command, in cell D1 I have the following formula that I dragged down: ="copy " & """" & C1 & """" & " " & """" & A1 & """"
I copied the cells in column D to Notepad and saved the .bat file in the same folder as my text files and desired folders. I closed Excel as I no longer needed it.
I ran the .bat file.
After that I deleted the text files and using Bulk Rename Here utility I removed the first 4 characters from each of the folder names, and now my folders are: Folder 1 title Folder 2 title Folder 3 title Folder 4 title Folder 5 title Folder 6 title etc. Folder n title
_______________________________________
|
|
pus acum 2 saptamani |
|