20 lines
474 B
Bash
Executable file
20 lines
474 B
Bash
Executable file
#!/usr/bin/env sh
|
|
|
|
# Descripción: convertidor de formato .pdf a .txt
|
|
# Dependencias: poppler-utils
|
|
# Author: rob // punk_coders
|
|
|
|
# Equivalencias sustituyendo al parámetro $1:
|
|
# 1. extensión: ${1##*.}
|
|
# 2. dirname: ${1%/*}
|
|
# 3. basename: ${1##*/}
|
|
# 4. pathfile sin extensión: ${1%.*} y ${_file%.*}
|
|
|
|
file="$1"
|
|
name="${0##*/}"
|
|
|
|
if [ "${1##*.}" = "pdf" ]; then
|
|
printf "%s\n" "Convirtiendo ${1##*/} a formato TXT... "
|
|
pdftotext -layout "$1" "${1%.*}".txt
|
|
fi
|