Linux batch to convert PDF files to txt text of the small program __json

Source: Internet
Author: User

Original: Http://forum.ubuntu.org.cn/viewtopic.php?f=21&t=251071&start=0

The core part of this program is to invoke the Pdftotxt command under Linux.

#!/bin/bash #与朋友们共享. If you have a good change of opinion, please leave a message to me. ubuntu.org.cn centerpoint Thank IRC#UBUNTU-CN IGoogle and other Daniel's help. Please comment. #功能: This program can convert PDF files into txt text in bulk. #用法: The number of maxdepth is directory depth, 1 is the directory. Save this file as pdf2txt.sh, set permissions to executable, and copy to the PDF file directory you want to convert. At the command line, CD to that directory. #执行./pdf2txt.sh can be. #作者: ubuntu.org.cn centerpoint 2010.1.6 #扫描的文件类型. Find./-maxdepth 1-name ' *.pdf ' >files.mybak myi=0 while read-line do filename= ' ${line##*/} '; Myi= ' echo ' $myi +1 "|BC ' echo" ************************ $myi *************************** "Ls-sh" ${filename} "Pdftotext" ${filename} "Ls-sh" ${filename%%.pdf}.txt "Done < Files.mybak RM Files.mybak

Related Article

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.