A pile of Word documents contains the product number, order number, etc., but the name of Word is document 1, report 1 and other meaningless documents that want to be deleted in batches to improve the efficiency of work and avoid affecting our processing of Word. Hand open to view each document, write down the number of the bar code and then rename the file, this series of operations down, is it will feel very boring and prone to errors? Especially when dealing with hundreds or thousands of files, it is a nightmare. So we have received many Doc and Oocx files, each of which contains bar codes. how can we use the numbers of these bar codes as the new file names of d to open this bar code o?
This article will specifically explain in detail for everyone, realize automatic batch extraction of bar code content and use it as a news program, make file management more efficient, and solve the problem with me!
Preview of the effect of modifying the barcode number in Word as a new name
before treatment:

after treatment:

method 1: Use HeSoft Doc Batch Tool Rename barcode to file name in Word
recommended Index:★★★★★
Advantages:
- the graphical interface is easy to understand, open to operate, small white can also be easily used., And also supports hundreds of thousands of files at the same time.
- The added files are processed locally and do not have the nature of the uploaded files, protecting the privacy of users.
Disadvantages:
- can only be installed in a computer.
Operation steps:
1. Open 【 HeSoft Doc Batch Tool ], select [File Name]-[Rename Word File with File Content]].

2. Select a method in [Add File] or [Import File from Folder] to add Word that needs bar code number as the file name, or drag the file directly below, and then click Next.

3. Enter the setting options interface, select [First Barcode Picture] in the search area, and select [Overwrite Entire File Name] in the location. If you want to keep the original file name, you can choose to add it to the left or right of the file name. Finally, click Next, click Browse and select the location to save the new file.

4. After the processing is completed, click on the path to open the folder. Word with bar codes in the file has been successfully renamed.

Method 2: Use Python to automatically identify and rename
recommended Index:★★★☆ ☆
advantages:
- fully automated batch processing and supports multiple barcode formats.
- It can be integrated into the work flow.
Disadvantages:
- basic programming knowledge is required and learning costs are high.
- The Python environment needs to be installed, and the initial setup is more complicated.
Operation steps:
install Python and Python-docx libraries
2. Create the rename.py file and enter:
import OS
import docx
import re
for file in OS .listdir('.'):
if file.endswith('.docx'):
doc = docx.Document(file)
for para in doc.paragraphs:
If re.match (r '^ \ d {10,} $', para. text): # Match barcode digits
new_name = para.text '.docx'
OS .rename(file, new_name)
break
3. Put it into the document folder and double-click to run it.
Method 3: Manually copy and paste the barcode code to the Word file name
recommended Index:★★☆ ☆ ☆
advantages:
- completely free without the need for any software.
- Simple operation without threshold, and the basic will not go wrong.
Disadvantages:
- very time consuming and very inefficient.
- When there are many documents, they are easy to miss.
Operation steps:
1. Open the Word document, find the number under the barcode, and select the number to copy.

2. Close Word, right-click to rename and paste.

3, repeat the operation of other files can be.