| Forum Home | ||||
| Press F1 | ||||
| Thread ID: 33230 | 2003-05-11 09:45:00 | batchfile renaming | mejobloggs (264) | Press F1 |
| Post ID | Timestamp | Content | User | ||
| 143167 | 2003-05-11 09:45:00 | I am wanting to add 'joe' onto the end of 150 files. Is there a quick way to do this? Was there a program on a pc world cd, if so what month? Thanks |
mejobloggs (264) | ||
| 143168 | 2003-05-11 09:47:00 | Rename4U is good so is CKRename I think one of them were on a PCW CD... or maybe Netguide |
somebody (208) | ||
| 143169 | 2003-05-11 09:50:00 | > I am wanting to add 'joe' onto the end of 150 files. > Is there a quick way to do this? Yep, I think there is a program on either this month or last months Netguide CD, Give me a few mins & I will have look :) |
stu140103 (137) | ||
| 143170 | 2003-05-11 09:59:00 | Microsoft Excel :) If you want to know more I'll post instructions... Mike. |
Mike (15) | ||
| 143171 | 2003-05-11 10:00:00 | excel??????? | somebody (208) | ||
| 143172 | 2003-05-11 10:19:00 | > excel??????? Yeah, Microsoft Excel - it works with Excel 2000, XP, and Office Excel 2003 (and most probably earlier versions as well, but I haven't tried on them). Mike. |
Mike (15) | ||
| 143173 | 2003-05-11 10:21:00 | He may not be interested but I certainly am Mike. | -=JM=- (16) | ||
| 143174 | 2003-05-11 11:29:00 | I'll try to make this make sense... First make a list of the files you want to rename (dir in a dos window will do this) and store it in a CSV (Comma Seperated Values) file dir *.txt /b > files.csvSomething like that would work (replace the *.txt to whatever wildcarded file selection you want). Open the CSV in Microsoft Excel. Select the column of filenames and copy it to Column H. Select the first column of filenames (not the copy). Use the Excel function "Text to columns" (you should be able to find it in the "Data" menu). In the Window that opens click the radio button next to "Delimited" and click "Next". On the next screen, select "Other" under "Delimiters" and type a "." in the box and click Finish. That should seperate the filename with the file extension. Highlight the column with the file extension and select Insert > Columns. In the first cell of the new column type the word you want to add to the filenames. In a blank cell further over the page (such as cell E1) type the following: =concatenate(a1,b$1,c1)[pre]and press enter. Now select that cell and drag down the length of however many cells that need to be filled (as many as there are files). Press "Ctrl+D" to fill the series down. Highlight the column of new filenames and press "Ctrl+C" to copy, then right-click somewhere in the selected column and click "Paste Special", and choose "Values" from the dialogue and click OK. Now you should have a column of old filenames (column H) and a column of new filenames (column E). now in another column (lets say column J) type the following: [pre]=concatenate("REN ",h1," ",e1) and press enter. Select down again and "Ctrl+D" to fill down. Copy that new column into a empty text file (in Notepad) and save as a batch file called "rename.bat" and save it in the folder that contains the files you want to rename. Open a DOS window again and navigate to that folder and run rename.bat. That should rename all the files to the new filename. :D This might need a little tweaking, but it does the job quite well (I use it several times a week at work). It may look complicated, but once you know how to do it, it can be done quite quickly. HTH Mike. |
Mike (15) | ||
| 143175 | 2003-05-11 11:31:00 | Sorry - forum bug... the PRE tag doesn't always close properly. Mike. |
Mike (15) | ||
| 143176 | 2003-05-11 14:46:00 | Sorry Mike but it is far easier and faster to use a batch file to do this as long as the renaming is consistant. | mikebartnz (21) | ||
| 1 2 | |||||