Skip to content

Commit

Permalink
Eliminar duplicados. Contruir directorio de resumenes
Browse files Browse the repository at this point in the history
  • Loading branch information
s-nt-s committed Jun 25, 2021
1 parent 13f923a commit adee66d
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 30 deletions.
8 changes: 2 additions & 6 deletions docs/materiales/tree/pack1.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<body>

<pre><code>
<span class="NORM" title="Pack_1_PreparaTIC27">Pack_1_PreparaTIC27.zip</span>
<span class="NORM" title="">Pack_1_PreparaTIC27.zip</span>
├── <span class="DIR" title="001 La Constitución (I)">001 La Constitución (I)</span>
│   ├── <span class="DIR" title="001 La Constitución (I)/Contenidos">Contenidos</span>
│   │   ├── <span class="NORM" title="001 La Constitución (I)/Contenidos/PreparaTIC_25_001 - Resumen express.pdf">PreparaTIC_25_001 - Resumen express.pdf</span>
Expand Down Expand Up @@ -1539,8 +1539,7 @@
│   └── <span class="NORM" title="097 Metricas y evaluacion de la calidad del software/Esquemas/PDF/CALIDAD 2016.pdf">CALIDAD 2016.pdf</span>
├── <span class="DIR" title="098 Estimación SW">098 Estimación SW</span>
│   ├── <span class="DIR" title="098 Estimación SW/Contenidos">Contenidos</span>
│   │   ├── <span class="NORM" title="098 Estimación SW/Contenidos/PreparaTIC_27_098 - Resumen.pdf">PreparaTIC_27_098 - Resumen.pdf</span>
│   │   └── <span class="NORM" title="098 Estimación SW/Contenidos/PreparaTIC_27_098-Resumen.pdf">PreparaTIC_27_098-Resumen.pdf</span>
│   │   └── <span class="NORM" title="098 Estimación SW/Contenidos/PreparaTIC_27_098 - Resumen.pdf">PreparaTIC_27_098 - Resumen.pdf</span>
│   └── <span class="DIR" title="098 Estimación SW/Doc Adicional">Doc Adicional</span>
│   ├── <span class="NORM" title="098 Estimación SW/Doc Adicional/2016- BlogJ.GARZAS vocalTribunalConv2016 ESTIMACIÓN.docx">2016- BlogJ.GARZAS vocalTribunalConv2016 ESTIMACIÓN.docx</span>
│   ├── <span class="NORM" title="098 Estimación SW/Doc Adicional/examen-con-ejemplo-estimacion-casos-uso.pptx">examen-con-ejemplo-estimacion-casos-uso.pptx</span>
Expand Down Expand Up @@ -1774,16 +1773,13 @@
│   │   ├── <span class="NORM" title="113 Redes inalambricas/Doc adicional/802.11ax white paper.pdf">802.11ax white paper.pdf</span>
│   │   ├── <span class="NORM" title="113 Redes inalambricas/Doc adicional/bluetooth-5-faq.pdf">bluetooth-5-faq.pdf</span>
│   │   ├── <span class="NORM" title="113 Redes inalambricas/Doc adicional/evolucion_802.11.pdf">evolucion_802.11.pdf</span>
│   │   ├── <span class="NORM" title="113 Redes inalambricas/Doc adicional/Introducción a las redes de area corporal (BAN). Norma 802.15.6(1).pdf">Introducción a las redes de area corporal (BAN). Norma 802.15.6(1).pdf</span>
│   │   ├── <span class="NORM" title="113 Redes inalambricas/Doc adicional/Introducción a las redes de area corporal (BAN). Norma 802.15.6.pdf">Introducción a las redes de area corporal (BAN). Norma 802.15.6.pdf</span>
│   │   ├── <span class="NORM" title="113 Redes inalambricas/Doc adicional/Introducción a NFC. Tema 113.pdf">Introducción a NFC. Tema 113.pdf</span>
│   │   ├── <span class="NORM" title="113 Redes inalambricas/Doc adicional/Norma 802.15.7 (LIFI).pdf">Norma 802.15.7 (LIFI).pdf</span>
│   │   ├── <span class="NORM" title="113 Redes inalambricas/Doc adicional/PreparaTIC XXV Acceso al medio CSMA-CA. Breve descripción. Tema 113.pdf">PreparaTIC XXV Acceso al medio CSMA-CA. Breve descripción. Tema 113.pdf</span>
│   │   ├── <span class="NORM" title="113 Redes inalambricas/Doc adicional/PreparaTIC XXV Resumen 802.11 2018 (WiFi). Tema 113.pdf">PreparaTIC XXV Resumen 802.11 2018 (WiFi). Tema 113.pdf</span>
│   │   ├── <span class="NORM" title="113 Redes inalambricas/Doc adicional/Preparatic XXV Resumen Bluetooth 2018. Tema 113.pdf">Preparatic XXV Resumen Bluetooth 2018. Tema 113.pdf</span>
│   │   ├── <span class="NORM" title="113 Redes inalambricas/Doc adicional/PreparaTIC XXV Resumen WiMAX 2018. Tema 113.pdf">PreparaTIC XXV Resumen WiMAX 2018. Tema 113.pdf</span>
│   │   ├── <span class="NORM" title="113 Redes inalambricas/Doc adicional/Resumen normas familia 802.15 (WPAN).pdf">Resumen normas familia 802.15 (WPAN).pdf</span>
│   │   ├── <span class="NORM" title="113 Redes inalambricas/Doc adicional/Síntesis de normas 802.11(1).pdf">Síntesis de normas 802.11(1).pdf</span>
│   │   ├── <span class="NORM" title="113 Redes inalambricas/Doc adicional/Síntesis de normas 802.11.pdf">Síntesis de normas 802.11.pdf</span>
│   │   ├── <span class="NORM" title="113 Redes inalambricas/Doc adicional/Tema 113 PreparaTIC XXV. Resumen WiFi 802.11 2018.pdf">Tema 113 PreparaTIC XXV. Resumen WiFi 802.11 2018.pdf</span>
│   │   └── <span class="NORM" title="113 Redes inalambricas/Doc adicional/White paper 802.11ad.pdf">White paper 802.11ad.pdf</span>
Expand Down
6 changes: 1 addition & 5 deletions docs/materiales/tree/pack1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1530,8 +1530,7 @@ Pack_1_PreparaTIC27.zip
│   └── CALIDAD 2016.pdf
├── 098 Estimación SW
│   ├── Contenidos
│   │   ├── PreparaTIC_27_098 - Resumen.pdf
│   │   └── PreparaTIC_27_098-Resumen.pdf
│   │   └── PreparaTIC_27_098 - Resumen.pdf
│   └── Doc Adicional
│   ├── 2016- BlogJ.GARZAS vocalTribunalConv2016 ESTIMACIÓN.docx
│   ├── examen-con-ejemplo-estimacion-casos-uso.pptx
Expand Down Expand Up @@ -1765,16 +1764,13 @@ Pack_1_PreparaTIC27.zip
│   │   ├── 802.11ax white paper.pdf
│   │   ├── bluetooth-5-faq.pdf
│   │   ├── evolucion_802.11.pdf
│   │   ├── Introducción a las redes de area corporal (BAN). Norma 802.15.6(1).pdf
│   │   ├── Introducción a las redes de area corporal (BAN). Norma 802.15.6.pdf
│   │   ├── Introducción a NFC. Tema 113.pdf
│   │   ├── Norma 802.15.7 (LIFI).pdf
│   │   ├── PreparaTIC XXV Acceso al medio CSMA-CA. Breve descripción. Tema 113.pdf
│   │   ├── PreparaTIC XXV Resumen 802.11 2018 (WiFi). Tema 113.pdf
│   │   ├── Preparatic XXV Resumen Bluetooth 2018. Tema 113.pdf
│   │   ├── PreparaTIC XXV Resumen WiMAX 2018. Tema 113.pdf
│   │   ├── Resumen normas familia 802.15 (WPAN).pdf
│   │   ├── Síntesis de normas 802.11(1).pdf
│   │   ├── Síntesis de normas 802.11.pdf
│   │   ├── Tema 113 PreparaTIC XXV. Resumen WiFi 802.11 2018.pdf
│   │   └── White paper 802.11ad.pdf
Expand Down
9 changes: 6 additions & 3 deletions tools/func.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ function rnm() {
}

function cln() {
if [ -d Pack_1_PreparaTIC27/Pack_1_PreparaTIC27 ]; then
rm -R Pack_1_PreparaTIC27/Pack_1_PreparaTIC27
fi
find . -type f -iname "*preparatic*cambios*" -delete
find . -type f -iname "*cambios*.txt" -delete
find . -type f -name desktop.ini -delete
find . -type d -empty -delete
if [ -d Pack_1_PreparaTIC27/Pack_1_PreparaTIC27 ]; then
rm -R Pack_1_PreparaTIC27/Pack_1_PreparaTIC27
if [ "$1" == "HARD" ]; then
find . -type d -execdir fdupes -dN "{}" \;
fi
find . -type d -empty -delete
find . -type d -regextype posix-egrep -regex '.*/[0-9]+\s*[\.\-]+\s*[^/0-9][^/]*' \
-execdir rename 's/([0-9][0-9]*)([ \.\-][ \.\-]*)(.*)/$1 $3/' "{}" +

Expand Down
33 changes: 32 additions & 1 deletion tools/unzip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ source "$(dirname "$0")/func.sh"

pushd $(mktemp -d)
uzip "$ZP"
cln
cln "HARD"

if [ $(ls -A . | wc -l) -eq 1 ]; then
cd *
Expand All @@ -25,3 +25,34 @@ UNZIPPED="$(pwd)"
popd > /dev/null

mv "$UNZIPPED" "$TARGET"

function mklink() {
file="$1"
tail="$2"
ext="${file##*.}"
fld="$(echo $file | cut -d'/' -f2)"
trg="${fld}${tail}.${ext}"
if [ -e "$trg" ]; then
trg="${fld}${tail}_bis.${ext}"
fi
ln -s "$file" "$trg"
}

cd "$TARGET"
ZP=$(basename "$ZP")
if [ "$ZP" == "Pack_1_PreparaTIC27.zip" ]; then
mkdir '000 Resumenes'
cd '000 Resumenes'
find .. -ipath "*/contenidos/*resumen*" -iname "*amplio*" -print0 |
while IFS= read -r -d '' file; do
mklink "$file" "_amplio"
done
find .. -ipath "*/contenidos/*resumen*" -iname "*express*" -print0 |
while IFS= read -r -d '' file; do
mklink "$file" "_express"
done
find .. -ipath "*/contenidos/*resumen*" ! -iname "*amplio*" ! -iname "*express*" -print0 |
while IFS= read -r -d '' file; do
mklink "$file" ""
done
fi
35 changes: 20 additions & 15 deletions tools/ztree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,34 @@ for ZP in "$@";do
fi

ZP=$(realpath "$ZP")
pushd $(mktemp -d) > /dev/null
lszip "$ZP" | while IFS= read FL; do
if [[ $FL == */ ]]; then
mkdir -p "$FL"
else
touch "$FL"
fi
done
UNZP="${ZP%.*}"
if [ -d "$UNZP" ]; then
pushd "$UNZP" > /dev/null
else
pushd $(mktemp -d) > /dev/null
lszip "$ZP" | while IFS= read FL; do
if [[ $FL == */ ]]; then
mkdir -p "$FL"
else
touch "$FL"
fi
done

cln
MAINDIR=""
if [ $(ls -A . | wc -l) -eq 1 ]; then
cd *
MAINDIR="$(basename $(pwd))"
cln
MAINDIR=""
if [ $(ls -A . | wc -l) -eq 1 ]; then
cd *
MAINDIR="$(basename $(pwd))"
fi
fi
BZP=$(basename "$ZP")
if [[ $OUTFILE == *.txt ]]; then
echo $BZP >> "$OUTFILE"
tree | head -n-1 | tail -n+2 >> "$OUTFILE"
tree -I '000 Resumenes' | head -n-1 | tail -n+2 >> "$OUTFILE"
elif [[ $OUTFILE == *.html ]]; then
#echo "<h1>$BZP</h1>" >> "$OUTFILE"
echo "<pre><code>" >> "$OUTFILE"
tree -H . -C | grep '<a .*href="' | \
tree -I '000 Resumenes' -H . -C | grep '<a .*href="' | \
sed "s|href=\"\.\">.</a><br>|href=\".\">$BZP</a><br>|" | \
sed -e "s|&nbsp;| |g" -e "s|<br>||g" -e "s|^\s*||g" | \
sed -e "s|<a |<span |g" -e "s|</a>|</span>|g" | \
Expand Down

0 comments on commit adee66d

Please sign in to comment.