Batch process TXT file batch to HTML file tool

Source: Internet
Author: User
Tags microsoft frontpage

When it comes to batch-to-HTML files, it's good to know that friends who like to read novels or often make ebooks and tutorials. Because we are faced with thousands of txt files each time, it is cumbersome to convert them into HTML files that are displayed correctly. Of course, there are a lot of software can be achieved, but I also under a lot of software, tried many times, the results are unsatisfactory. So I made a batch to solve this problem, and now share it with you.

Our batch tool is still saved with the original file name after conversion to HTML, and the default first action header row and page name ! So make sure that the first line of all txt files has a title, otherwise the first paragraph will be the title.

In order to ensure that the conversion results will not be garbled, before the conversion we want to determine the encoding of the TXT file before conversion to UTF-8, because UTF-8 is the common format of the Web page, many browsers by default are in UTF-8 encoded format opened. If all your txt files are GB2312 encoded, I will publish the batch of GB2312 to UTF-8 in the next article, so please look forward to not repeating them here.

Back to the Chase, copy the following code (split line below) into a notepad and save as "TXT batch to HTML tool. Bat"

---------------------Split Line---------------------

@echo off set utf8=65001set ansi=936chcp %utf8%      for /f "delims=" %%i in (‘dir /b *.txt‘) do (findstr /n .* "%%i" >.tmp(echo ^

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.