|
|
merkkisiivous.sh |
|
Etenkin sanalistoja yhdistellessä (hakiessa samaa sanaa tai sanaparia kahdelta eri listalta) on tarpeellista saada sanat suunnilleen samaan "formaattiin" ja merkkisiivous.sh on siihen tarkoitukseen laatimani edistyksellinen shell-skripti:
#!/usr/bin/env bash
#
# Skripti muuttaa tiedoston isot kirjaimet pieniksi ja suurimman osan
# erikoismerkeistä tavallisiksi aakkosiksi tai aakkospareiksi (ß ->
# ss ja æ -> ae). Myös perusskandit muutetaan.
#
# Käyttöohje:
# 1. Tee tyhjä hakemisto
# 2. Laita haluamasi tiedosto nimellä tiedosto.txt siihen
# 3. Laita myös tämä skripti sinne nimellä merkkisiivous.sh
# 4. Kirjoita chmod +x merkkisiivous.sh
# 5. Kirjoita ./merkkisiivous.sh
#
# Alkuperäisestä tiedosto.txt:stä tehdään
# tiedosto_merkkisiivous_bak.txt -niminen varmuuskopio ensin. Itse
# tiedosto.txt muuttuu sisällöltään niin, että se siivotaan
# erikoismerkeistä ja isoista kirjaimista.
#
# Tämän on kyhännyt Toti joulukuussa 2025 ja tämä on päivitetty 2.
# versio (1.1.2026), jossa merkkejä lisätty ja täysin uutena html-tagit
# mukana.
#
cp tiedosto.txt tiedosto_merkkisiivous_bak.txt
tr '[:upper:]' '[:lower:]' < tiedosto.txt > temp.txt
rm tiedosto.txt
cp temp.txt tiedosto.txt
rm temp.txt
sed -i -e 's/À/a/g' tiedosto.txt
sed -i -e 's/Á/a/g' tiedosto.txt
sed -i -e 's/Â/a/g' tiedosto.txt
sed -i -e 's/Ã/a/g' tiedosto.txt
sed -i -e 's/Ä/a/g' tiedosto.txt
sed -i -e 's/Å/a/g' tiedosto.txt
sed -i -e 's/Æ/ae/g' tiedosto.txt
sed -i -e 's/Ç/c/g' tiedosto.txt
sed -i -e 's/È/e/g' tiedosto.txt
sed -i -e 's/É/e/g' tiedosto.txt
sed -i -e 's/Ê/e/g' tiedosto.txt
sed -i -e 's/Ë/e/g' tiedosto.txt
sed -i -e 's/Ì/i/g' tiedosto.txt
sed -i -e 's/Í/i/g' tiedosto.txt
sed -i -e 's/Î/i/g' tiedosto.txt
sed -i -e 's/Ï/i/g' tiedosto.txt
sed -i -e 's/Ñ/n/g' tiedosto.txt
sed -i -e 's/Ò/o/g' tiedosto.txt
sed -i -e 's/Ó/o/g' tiedosto.txt
sed -i -e 's/Ô/o/g' tiedosto.txt
sed -i -e 's/Õ/o/g' tiedosto.txt
sed -i -e 's/Ö/o/g' tiedosto.txt
sed -i -e 's/Ø/o/g' tiedosto.txt
sed -i -e 's/Ù/u/g' tiedosto.txt
sed -i -e 's/Ú/u/g' tiedosto.txt
sed -i -e 's/Û/u/g' tiedosto.txt
sed -i -e 's/Ü/u/g' tiedosto.txt
sed -i -e 's/ß/ss/g' tiedosto.txt
sed -i -e 's/à/a/g' tiedosto.txt
sed -i -e 's/á/a/g' tiedosto.txt
sed -i -e 's/â/a/g' tiedosto.txt
sed -i -e 's/ã/a/g' tiedosto.txt
sed -i -e 's/ä/a/g' tiedosto.txt
sed -i -e 's/å/a/g' tiedosto.txt
sed -i -e 's/æ/ae/g' tiedosto.txt
sed -i -e 's/ç/c/g' tiedosto.txt
sed -i -e 's/è/e/g' tiedosto.txt
sed -i -e 's/é/e/g' tiedosto.txt
sed -i -e 's/ê/e/g' tiedosto.txt
sed -i -e 's/ë/e/g' tiedosto.txt
sed -i -e 's/ì/i/g' tiedosto.txt
sed -i -e 's/í/i/g' tiedosto.txt
sed -i -e 's/î/i/g' tiedosto.txt
sed -i -e 's/ï/i/g' tiedosto.txt
sed -i -e 's/ñ/n/g' tiedosto.txt
sed -i -e 's/ò/o/g' tiedosto.txt
sed -i -e 's/ó/o/g' tiedosto.txt
sed -i -e 's/ô/o/g' tiedosto.txt
sed -i -e 's/õ/o/g' tiedosto.txt
sed -i -e 's/ö/o/g' tiedosto.txt
sed -i -e 's/ø/o/g' tiedosto.txt
sed -i -e 's/ù/u/g' tiedosto.txt
sed -i -e 's/ú/u/g' tiedosto.txt
sed -i -e 's/û/u/g' tiedosto.txt
sed -i -e 's/ü/u/g' tiedosto.txt
sed -i -e 's/Á/a/g' tiedosto.txt
sed -i -e 's/á/a/g' tiedosto.txt
sed -i -e 's/Â/a/g' tiedosto.txt
sed -i -e 's/â/a/g' tiedosto.txt
sed -i -e 's/&Aelig;/ae/g' tiedosto.txt
sed -i -e 's/æ/ae/g' tiedosto.txt
sed -i -e 's/À/a/g' tiedosto.txt
sed -i -e 's/à/a/g' tiedosto.txt
sed -i -e 's/Å/a/g' tiedosto.txt
sed -i -e 's/å/a/g' tiedosto.txt
sed -i -e 's/Ã/a/g' tiedosto.txt
sed -i -e 's/ã/a/g' tiedosto.txt
sed -i -e 's/Ä/a/g' tiedosto.txt
sed -i -e 's/ä/a/g' tiedosto.txt
sed -i -e 's/Ç/c/g' tiedosto.txt
sed -i -e 's/ç/c/g' tiedosto.txt
sed -i -e 's/É/e/g' tiedosto.txt
sed -i -e 's/é/e/g' tiedosto.txt
sed -i -e 's/Ê/e/g' tiedosto.txt
sed -i -e 's/ê/e/g' tiedosto.txt
sed -i -e 's/È/e/g' tiedosto.txt
sed -i -e 's/è/e/g' tiedosto.txt
sed -i -e 's/Ë/e/g' tiedosto.txt
sed -i -e 's/ë/e/g' tiedosto.txt
sed -i -e 's/Í/i/g' tiedosto.txt
sed -i -e 's/í/i/g' tiedosto.txt
sed -i -e 's/Î/i/g' tiedosto.txt
sed -i -e 's/î/i/g' tiedosto.txt
sed -i -e 's/Ì/i/g' tiedosto.txt
sed -i -e 's/ì/i/g' tiedosto.txt
sed -i -e 's/Ï/i/g' tiedosto.txt
sed -i -e 's/ï/i/g' tiedosto.txt
sed -i -e 's/Ñ/n/g' tiedosto.txt
sed -i -e 's/ñ/n/g' tiedosto.txt
sed -i -e 's/Ó/o/g' tiedosto.txt
sed -i -e 's/ó/o/g' tiedosto.txt
sed -i -e 's/Ô/o/g' tiedosto.txt
sed -i -e 's/ô/o/g' tiedosto.txt
sed -i -e 's/Ò/o/g' tiedosto.txt
sed -i -e 's/ò/o/g' tiedosto.txt
sed -i -e 's/Ø/o/g' tiedosto.txt
sed -i -e 's/ø/o/g' tiedosto.txt
sed -i -e 's/Õ/o/g' tiedosto.txt
sed -i -e 's/õ/o/g' tiedosto.txt
sed -i -e 's/Ö/o/g' tiedosto.txt
sed -i -e 's/ö/o/g' tiedosto.txt
sed -i -e 's/ß/ss/g' tiedosto.txt
sed -i -e 's/Ú/u/g' tiedosto.txt
sed -i -e 's/ú/u/g' tiedosto.txt
sed -i -e 's/Û/u/g' tiedosto.txt
sed -i -e 's/û/u/g' tiedosto.txt
sed -i -e 's/Ù/u/g' tiedosto.txt
sed -i -e 's/ù/u/g' tiedosto.txt
sed -i -e 's/Ü/u/g' tiedosto.txt
sed -i -e 's/ü/u/g' tiedosto.txt
sed -i -e 's/Á/a/g' tiedosto.txt
sed -i -e 's/á/a/g' tiedosto.txt
sed -i -e 's/À/a/g' tiedosto.txt
sed -i -e 's/à/a/g' tiedosto.txt
sed -i -e 's/Â/a/g' tiedosto.txt
sed -i -e 's/â/a/g' tiedosto.txt
sed -i -e 's/Å/a/g' tiedosto.txt
sed -i -e 's/å/a/g' tiedosto.txt
sed -i -e 's/Ä/a/g' tiedosto.txt
sed -i -e 's/ä/a/g' tiedosto.txt
sed -i -e 's/ã/a/g' tiedosto.txt
sed -i -e 's/Ã/a/g' tiedosto.txt
sed -i -e 's/æ/ae/g' tiedosto.txt
sed -i -e 's/Æ/ae/g' tiedosto.txt
sed -i -e 's/Ć/c/g' tiedosto.txt
sed -i -e 's/ć/c/g' tiedosto.txt
sed -i -e 's/Č/c/g' tiedosto.txt
sed -i -e 's/č/c/g' tiedosto.txt
sed -i -e 's/Ç/c/g' tiedosto.txt
sed -i -e 's/ç/c/g' tiedosto.txt
sed -i -e 's/đ/d/g' tiedosto.txt
sed -i -e 's/ð/d/g' tiedosto.txt
sed -i -e 's/É/e/g' tiedosto.txt
sed -i -e 's/é/e/g' tiedosto.txt
sed -i -e 's/è/e/g' tiedosto.txt
sed -i -e 's/È/e/g' tiedosto.txt
sed -i -e 's/ê/e/g' tiedosto.txt
sed -i -e 's/Ê/e/g' tiedosto.txt
sed -i -e 's/ě/e/g' tiedosto.txt
sed -i -e 's/ë/e/g' tiedosto.txt
sed -i -e 's/Ë/e/g' tiedosto.txt
sed -i -e 's/ė/e/g' tiedosto.txt
sed -i -e 's/ğ/g/g' tiedosto.txt
sed -i -e 's/í/i/g' tiedosto.txt
sed -i -e 's/Í/i/g' tiedosto.txt
sed -i -e 's/Ì/i/g' tiedosto.txt
sed -i -e 's/ì/i/g' tiedosto.txt
sed -i -e 's/Î/i/g' tiedosto.txt
sed -i -e 's/î/i/g' tiedosto.txt
sed -i -e 's/ï/i/g' tiedosto.txt
sed -i -e 's/Ï/i/g' tiedosto.txt
sed -i -e 's/ı/i/g' tiedosto.txt
sed -i -e 's/ł/l/g' tiedosto.txt
sed -i -e 's/ń/n/g' tiedosto.txt
sed -i -e 's/ň/n/g' tiedosto.txt
sed -i -e 's/ñ/n/g' tiedosto.txt
sed -i -e 's/Ñ/n/g' tiedosto.txt
sed -i -e 's/ó/o/g' tiedosto.txt
sed -i -e 's/Ó/o/g' tiedosto.txt
sed -i -e 's/ò/o/g' tiedosto.txt
sed -i -e 's/Ò/o/g' tiedosto.txt
sed -i -e 's/ô/o/g' tiedosto.txt
sed -i -e 's/Ô/o/g' tiedosto.txt
sed -i -e 's/Ö/o/g' tiedosto.txt
sed -i -e 's/ö/o/g' tiedosto.txt
sed -i -e 's/ő/o/g' tiedosto.txt
sed -i -e 's/õ/o/g' tiedosto.txt
sed -i -e 's/Õ/o/g' tiedosto.txt
sed -i -e 's/Ø/o/g' tiedosto.txt
sed -i -e 's/ø/o/g' tiedosto.txt
sed -i -e 's/ř/r/g' tiedosto.txt
sed -i -e 's/š/s/g' tiedosto.txt
sed -i -e 's/Š/s/g' tiedosto.txt
sed -i -e 's/Ş/s/g' tiedosto.txt
sed -i -e 's/ß/ss/g' tiedosto.txt
sed -i -e 's/Ú/u/g' tiedosto.txt
sed -i -e 's/ú/u/g' tiedosto.txt
sed -i -e 's/ù/u/g' tiedosto.txt
sed -i -e 's/Ù/u/g' tiedosto.txt
sed -i -e 's/Û/u/g' tiedosto.txt
sed -i -e 's/û/u/g' tiedosto.txt
sed -i -e 's/Ü/u/g' tiedosto.txt
sed -i -e 's/ü/u/g' tiedosto.txt
sed -i -e 's/ū/u/g' tiedosto.txt
sed -i -e 's/ÿ/y/g' tiedosto.txt
sed -i -e 's/Ž/z/g' tiedosto.txt
sed -i -e 's/ž/z/g' tiedosto.txt
sed -i -e 's/ӓ/a/g' tiedosto.txt
sed -i -e 's/ӧ/o/g' tiedosto.txt |
|
|
|