Replace all files in a folder with one file but keep the names?
-
Hi, I have about 1000 files in a folder each with different names, I would like to replace all of those files in the folder with one single file but still keep the original file names, is this possible? E.g. replace: file1, file2, file3, file4, thing1, thing2, thing 3, xyz1,xyz2 all with nothing.file but still let them have their original names.
-
Answer:
That can be done but will require several steps. If I were to do it, I would export the full name (including the file extension which is normally hidden from view in Windows Explorer) of the list of files in a folder to a text file, import the list to Excel, insert the copy command and the name of single file before the names of each file and append the /y on each line. After that, save the file back to a text file and give it a .bat or .cmd file extension. Run the batch file and there you go. EDIT: Put the file list on column A starting on row 1. On column B starting on row 1 cut and paste this as is: =CONCATENATE("copy nothing.file", " ", B1) Copy B1 down to the last row. The B1 should change like B2, B3, B4, etc. as you go down each row. Highlight everything on Column B. Right click inside the range and select Copy. Right click on Column C and select Paste option Values (V). Widen all columns as necessary so you'll see the result. Highlight all results on Column C and select Copy. Open a Notepad and Paste there. Save the file as SIMON.BAT. Don't forget to click on the Save as type All Files (*.*). Otherwise it will be saved as SIMON.BAT.TXT. Now move that file and your "nothing.file" to an empty folder. Double click on the SIMON.BAT. Watch the batch file generate the copy of nothing.file with different file names that match those in your original list. By the way, I removed the " /y" at the end of the command because you will not be overwriting on any file on an empty folder. It is only necessary if the files you want to replace are contained in the same folder. If you don't put the " /y" you will be asked 1000 times if you want to overwrite each file. If that's what you want, the equation on B1 should be: =CONCATENATE("copy nothing.file", " ", B1, " /y") I won't be coming back to this post and won't be able to read your additional details if you have any. If you need further help, send me an email through my profile.
Simon at Yahoo! Answers Visit the source
Other answers
for i in * do cp nothing.file "$i" done
Charlie Kelly
Put them in a WinZip archive file. http://www.winzip.com/
MrTradewell
Related Q & A:
- How to merge multiple CSV files into a single CSV file?Best solution by solveyourtech.com
- How do I upload multiple files into a folder?Best solution by Yahoo! Answers
- How do i send a folder instead of indivual files?Best solution by Yahoo! Answers
- How to move completely move a folder to one place or another?Best solution by Stack Overflow
- How can I transfer all of my Yahoo email files to a document file in my documents?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.