How to change names in batches in Excel

Source: Internet
Author: User

If you want to give a number of Office documents in front of the file name plus numeric numbers, in addition to one after another to manually add renaming, there is no convenient way? In fact, it is very simple, using Notepad and Excel can be used to achieve a lot of irregular file renaming purposes.

Here is a batch of Office documents, as shown in the picture.

We'll change the name to look like this:

First, create a blank text with Notepad in the directory where the document is located, and save it as a filename ls.bat (note that the extension cannot be txt and be changed to BAT). Then enter the following line of simple code inside (note that there are three spaces in the line of code, do not omit):

DIR *.*/b >list. Txt

After you save the bat file, double-click the file and you will find a new file LIST.TXT in the document directory. Open it and look, it's a list of files. Remove the two lines above, leaving only a useful list.

It's okay to have a list, and now we'll copy it to column B in a blank Excel table, then fill in column A with an automatic number, and enter a simple formula "=" REN "&B1&" &A1& "in cell C1. &B1, and drop down to fill C1 to the end of column C. Then copy the column C cell contents.

Backfill the copied content into the Ls.bat file, overwrite the contents of the bat file, and double-click Ls.bat to run, so that the file is renamed automatically by the serial number plus title.

If you are using this compression software, batch renaming can be done quickly in the following way. In the folder select all the files that you want to rename, right-click and select "Good pressure → other compression command → batch file rename" menu command.

Enter "#-*" in the Naming convention box under the "Overall" tab of the renamed window that pops up, the setting number starts at 1, increment 1, digits 2, and then click the "Start renaming" button to complete the rename of the batch file.

Many ways to rename a file in batches, the above introduced a manual, a tool method, is relatively easy and simple method, we can get what they want.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.