You can use:
for i in *.txt *.html
do
mv "$i" "${i%%.*}.directory/$i"
done
Run this in same directory where you are having files. It will remove trailing .txt and .html from file names and then will move files to destination directory.
You can use:
for i in *.txt *.html
do
mv "$i" "${i%%.*}.directory/$i"
done
Run this in same directory where you are having files. It will remove trailing .txt and .html from file names and then will move files to destination directory.