Skip to content

Script to change one word in a lot of files. Designed to translate websites, but it can give you other uses.

License

Notifications You must be signed in to change notification settings

miguelFLG13/ChangeWords

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

ChangeWords v1.0

#ENG

Script to change one word in a lot of files. Designed to translate websites, but it can give you other uses.

This script take a Excel document or a text file with the words to change and it the changes into other file.

Install

You need install some python modules to use this script:

  • Xlrd:
pip install xlrd
  • Htmlentities:
pip install htmlentities

If you didn't install pip, before, you need (in Ubuntu):

sudo apt-get install python-pip

Remember that you need admin permissions.

Getting Started

This script is easy to use.

Usage: python changeWords.py options file_with_words path_change

Options: a Complete, without question c Exact match

Remember: You can use xls files and txt files

Examples

Simple change with Excel file:

python changeWords.py ./file.xls ./path/to/change

Simple change with text file:

python changeWords.py ./file.txt ./path/to/change

Change with options:

python changeWords.py -ca ./file.xls ./path/to/change

Show help:

python changeWords.py help

Excel file (xls)

First column is the word to find, and second column the word to change.

Text file (txt)

Each line is written in the search word and separated by a weighted replacement as seen in this example:

Ver\tO seu\n Carrito\tCesto\n

#SPA

Script para cambiar una palabra en muchos archivos. Diseñado para traducir páginas web, pero se le puede dar otros usos.

Este script coge un archivo de Excel o de texto y cambia en otro archivos una palabra por otra.

Instalar

Necesitas instalar unos módulos de python para hacer funcionar el script:

  • Xlrd:
pip install xlrd
  • Htmlentities:
pip install htmlentities

Si no tienes instalado pip, antes de nada tienes que instalarlo, en Ubuntu sería:

sudo apt-get install python-pip

Recuerda que necesitas permisos de administrador.

Comenzar a usarlo

Este script es fácil de usar.

Uso: python changeWords.py options file_with_words path_change

Opciones: a hacer sin preguntar c coincidencia exacta

Recuerda: Puedes usar archivos xls and txt.

Ejemplos

Cambio simple con archivo de Excel:

python changeWords.py ./file.xls ./path/to/change

Cambio simple con archivo txt:

python changeWords.py ./file.txt ./path/to/change

Cambio con opciones:

python changeWords.py -ca ./file.xls ./path/to/change

Mostrar ayuda:

python changeWords.py help

Archivo Excel (xls)

La primera columna sería la palabra a cambiar y la segunda la palabra que va a remplazar a la que se cambia.

Archivo de texto (txt)

Se escribe en cada línea la palabra a buscar y la de remplazo separadas por un tabulado como se puede ver en este ejemplo:

Ver\tO seu\n Carrito\tCesto\n

About

Script to change one word in a lot of files. Designed to translate websites, but it can give you other uses.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages