[Perl] text/code batch conversion tool

Source: Internet
Author: User
The Perl script batchReplace. pl can be used to swap text/code in files in batches. You can search for the specified type of files in the specified directory and check the subdirectories in a step-by-step manner. copy the directory structure of the input files when outputting the files.

The Perl script batchReplace. pl can be used to swap text/code in files in batches. You can search for the specified type of files in the specified directory and check the subdirectories in a step-by-step manner. copy the directory structure of the input files when outputting the files.

The win32utility program batchreplace.exe is a executable program compiled by a Perl script. it can be executed without installing the Perl runtime environment.

Apply in command line

BatchReplace.exe [-I file import path (or directory containing the file)] [-o output file status (file or directory)] [-c expand the name of the batch import file, with ". "Start, multiple extended names are separated by" | ".] [-m matching mode] [-I (uppercase/lowercase letters that are not matched)] [-G (global search for the content to be matched)] [-e exception string is a supplement to the matching mode. if such a string is found in the matching result, do not match] [-r change content]

The preceding parameters have no order restrictions. When the file path involved by the-o parameter does not exist, it is automatically created. When the output file already exists, the original content of the file will be overwritten. (For security reasons, do not output data to the original position of the input file to avoid irreparable loss .)

For example:
BatchReplace.exe-I d: \ gaoshu1-o d: \ do \ 123 \ 456-e http://www.blueidea.com/

Set parameters through the configuration file batchReplace. set

The configuration file may contain the following configuration items (case-sensitive ):

Input = E: \ fna \ specifies the Input path, which is equivalent to the default value of the command line parameter-I.
-I = E: \ fna \ same as above.
Output = E: \ DNA walks \ specifies the pre-input path, which is equivalent to the default value of the command line parameter-o.
-O = E: \ DNA walks \ same as above.
Match = uuuuuuuuu
Yyyyyyyyyyyyyyyyyyyyyyyy
Wwwwwwwwwwwwwwwwwww
Uuuuuuuuuu
Yyyyyyyyyyyyyyyyyyyyyyyy

Place the configuration file batchReplace. set and batchReplace.exe in the same directory.

Reference:
Match = uuuuuuuuu
Yyyyyyyyyyyyyyyyyyyyyyyy
Wwwwwwwwwwwwwwwwwww
Uuuuuuuuuu
Yyyyyyyyyyyyyyyyyyyyyyyy

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.