#!/bin/sh # # convhtml : .txt to .html converter. # # usage: for a file ending with the ".txt" extension: # convhtml file_name # # it will output a file named file_name.html # # June 19, 1998 # Revised in May 23, 2002 # Ilker Ficicilar - ilkerf@geocities.com # # if [ "$1" != "" ] then if test -f $1.txt then nm=$1 echo "" > $1.html head $1.txt | parcala | while read qw do echo -n $qw" " done >> $1.html echo "" >> $1.html echo "" >> $1.html echo "> $1.html echo "\">" >> $1.html echo "> $1.html echo "\">" >> $1.html echo "" >> $1.html cat <> $1.html
EOF11 cat $1.txt | sort | tail -38 | wc | while read dg do set $dg satir=`expr $3 / $1` set $nm satir=`expr $satir + 15` echo "satir= $satir" # # ">" ve "<" karakterlerini donusturerek yaziyi oku/tara. # cat $1.txt | sed "s/>/\>/g" | sed "s/$1" fi #echo "$1" | grep "http://" | while read gh #do #echo "" "$gh" "" #done #echo "$1" > .tmp.convhtml2 #if grep "http://" .tmp.convhtml2 > /dev/null #then #echo " " #else #echo "$1" #fi shift done if [ "$we" -lt $satir ] then echo "
" # # bu er degiskeni, programin ileriki surumlerinde gerekebilir. # simdilik durmasinda bir sakinca yok. # er=kisa else er=uzun fi done else echo "

" fi done >> $1.html echo >> $1.html # # evet isimiz bitti # echo "

" >> $1.html done else echo echo " $1.txt diye bir dosya yok." echo "lutfen sadece convhtml yazarak yardim alin." echo fi else echo echo "convhtml : .txt uzantili dosyalari .html bicimine cevirme." echo echo 19 Haziran 1998 echo "Ilker Ficicilar - filker@mailexcite.com" echo echo kullanimi echo --------- echo echo " Sonu .txt ile biten dosya_adi.txt gibi bir dosyayi," echo "convhtml dosya_adi seklinde \".txt\" uzantisini yazmaksizin calistiririz." echo echo "Program, dosya_adi.html isminde bir HTML dosyasi olusturacaktir." echo fi # Asagida bir yazi dosyasinin satirlarinin uzun mu kisa mi oldugunu #saptayan program parcasini bulabilirsiniz. # ##!/bin/sh #cat $1.txt | while read qw #do #echo $qw | wc -c | while read we #do #if [ "$we" -lt 60 ] #then #echo kisa #else #echo uzun #fi #done #done