database question

Bruce Dawson jbd at codemeta.com
Mon Nov 24 00:12:19 EST 2003


Do you mean something like:

    #!/bin/sh
    FILENAME=`basename $1 .pdf`
    set -- `echo $FILENAME | sed -e 's/_/ /g'`
    p1=$1
    p2=$2
    p3=$3
    p4=$4
    p5=$5
    # Following assumes the testtable table has already be created in #
    mysql's test database.
    echo "insert into testtable set
    p1='$p1',p2='$p2',p3='$p3',p4='$p4',p5='$p5'" | mysql -u test -p \
    test test
    mkdir -p /customers/$p1
    mv $FILENAME /customers/$p1/${p2}_${p3}_${p4}_${p5}

--Bruce

On Sun, 2003-11-23 at 22:19, Vince McHugh wrote:
> Hi All,
> 
>    I'd like to preface this question by saying I don't
> know much about databases. But I am trying to work
> with a customer who is trying to do the following...
> 
>   I am supplying them with scanning equipment that can
> produce a pdf file with "meta data" in the file name.
> It will look something like this:
> 
>  info1_info2_info3_info4_info5.pdf
> 
> The info1 - info5 will be replaced by specific meta
> data with information about the PDF file. 
> 
>    Now the question, We would like to know if there is
> a way to write a script that would strip out the info
> fields separated by underscores (this separator could
> be changed to any valid character) and populate
> database fields, possibly using MySQL.
> 
>  The second thing that we would like the script to do
> is to move the file from one folder to another
> possibly based one one of the info fields name. For
> instance if the info1 field is a customers name or
> number that the file would be moved to a folder with
> that name.
> 
>   I hope that this is OK to ask here, if not I would
> appreciate pointing me in the right direction. Thanks
> for any feedback.
>   
> =====
> .           Regards,       
>           Vince McHugh
>      Systems Support Manager
>           NECS\Canon
> 
> __________________________________
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20031124/d12e5095/attachment.bin


More information about the gnhlug-discuss mailing list