I'm looking for a tool to create an XML-document from my disk structure. If
possible, it should be able to read out the title-tag in HTML files. Aim:
Create a plan of a web site.
Any solutions??
Jan
-------------------
remove nospam from e-mail- address
> I'm looking for a tool to create an XML-document from my disk structure. If
> possible, it should be able to read out the title-tag in HTML files. Aim:
> Create a plan of a web site.
By "disk structure", do you mean what files are in what directories?
Or what partitions the disk has? Or what drives are mounted? Or what?
Assuming it's the first you're after, you could put this script,
using the name 'xdir', into your PATH.
$ cat xdir
#!/bin/sh
echo '<directory name="'`pwd`'">'
for jj in `ls`; do
if test -f $jj; then
echo '<file name="'$jj'" />'
else
if test -d $jj; then
cd $jj
xdir
cd ..
fi; fi
done
echo '</directory>'
--Mike Amling
Michael Amling - 07 Dec 2003 16:49 GMT
>> I'm looking for a tool to create an XML-document from my disk
>> structure. If
[quoted text clipped - 6 lines]
> Assuming it's the first you're after, you could put this script, using
> the name 'xdir', into your PATH.
Here's a slightly fancier one. I may end up using something like this
myself.
#!/bin/sh
echo '<directory name="'`pwd`'">'
for jj in `ls`; do
if test -f $jj; then
TITLE=`grep '<[tT]itle>' $jj|grep '</[tT]itle>'`
if test -z "$TITLE"; then
echo '<file name="'$jj'" />'
else
echo '<file name="'$jj'" title="'`echo $TITLE|\
sed -e 's/<[tT]itle>//;s/<\/[tT]itle>//'|\
tr '\r' ' '`'" />'
fi
else
if test -d $jj; then
cd $jj
xdir
cd ..
fi; fi
done
echo '</directory>'
--Mike Amling